/* ================= profile page ================= */

.brand-mark-link {
  text-decoration: none;
  cursor: pointer;
}

.brand-mark-link svg { width: 20px; height: 20px; }

/* ---------------- accounts section ---------------- */
.accounts-section {
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.section-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 460px;
}

.btn-add-account {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--sky-bright), var(--sky-deep));
  color: #06172B;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(79,182,255,0.7);
  transition: filter 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-add-account:hover { filter: brightness(1.08); }
.btn-add-account:active { transform: scale(0.97); }

/* ---------------- account cards ---------------- */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(17,37,68,0.7), rgba(13,30,54,0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.account-card:hover {
  border-color: var(--sky-deep);
  background: linear-gradient(180deg, rgba(23,51,92,0.8), rgba(17,37,68,0.6));
}

.account-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--sky-bright), var(--sky-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06172B;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-mono);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-phone {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  direction: ltr;
  text-align: left;
}

.account-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--green);
}

.account-meta .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.btn-remove-account {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-remove-account:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ================= modals ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6,11,22,0.72);
  backdrop-filter: blur(6px);
}

.modal-overlay.show {
  display: flex;
  animation: overlay-in 0.2s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--navy-850), var(--navy-900));
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 30px 26px 26px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(79,182,255,0.08);
  animation: modal-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(6,11,22,0.5);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.modal-close:hover {
  color: var(--sky-bright);
  border-color: var(--sky);
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--sky-bright), var(--sky-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 10px 28px -10px rgba(79,182,255,0.6);
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.modal-sub {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.85;
}

.modal-sub b {
  color: var(--text);
  font-weight: 600;
  unicode-bidi: plaintext;
}

/* account modal steps (mirrors login step logic) */
.acc-step {
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.acc-step.active { display: flex; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-field {
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(6,11,22,0.55);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  padding: 4px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-field.focused {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(79,182,255,0.14);
}

.phone-field .cc {
  font-size: 15px;
  color: var(--text-dim);
  padding-left: 10px;
  border-left: 1.5px solid var(--border-light);
  margin-left: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.phone-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 16px;
  padding: 14px 0;
  color: var(--text);
  text-align: right;
  direction: ltr;
  letter-spacing: 0.5px;
}

.phone-field input::placeholder {
  color: var(--text-faint);
  font-size: 14px;
}

.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sky-bright), var(--sky-deep));
  color: #06172B;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(79,182,255,0.7);
  transition: transform 0.15s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:active { transform: scale(0.97); }

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-btn .spinner {
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(6,23,43,0.35);
  border-top-color: #06172B;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.primary-btn.loading .spinner { display: inline-block; }
.primary-btn.loading .btn-label { display: none; }

.code-inputs {
  display: flex;
  gap: 10px;
  direction: ltr;
  margin-bottom: 6px;
}

.code-digit {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  background: rgba(6,11,22,0.55);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.code-digit:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(79,182,255,0.14);
}

.code-digit.filled {
  border-color: var(--sky-deep);
}

.code-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--green);
}

.check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  display: none;
  align-items: center;
  justify-content: center;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.check-circle.show { display: flex; }

@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.check-circle svg { width: 13px; height: 13px; }

.change-number {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--sky-bright);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}

.error-msg {
  color: var(--red);
  font-size: 12.5px;
  margin-top: 10px;
  text-align: center;
  display: none;
}

.error-msg.show { display: block; }

/* ---------------- warning modal ---------------- */
.warn-modal {
  max-width: 400px;
  text-align: center;
}

.warn-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(227,181,79,0.14);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.warn-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-warn-secondary,
.btn-warn-primary {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-warn-secondary:active,
.btn-warn-primary:active {
  transform: scale(0.97);
}

.btn-warn-secondary {
  background: rgba(79,182,255,0.12);
  border: 1px solid var(--border-light);
  color: var(--sky-bright);
}

.btn-warn-secondary:hover {
  border-color: var(--sky);
}

.btn-warn-primary {
  background: linear-gradient(135deg, var(--sky-bright), var(--sky-deep));
  border: none;
  color: #06172B;
  box-shadow: 0 8px 20px -8px rgba(79,182,255,0.7);
}

.btn-warn-primary:hover { filter: brightness(1.08); }

@media (max-width: 420px) {
  .section-head { flex-direction: column; }
  .btn-add-account { width: 100%; justify-content: center; }
  .code-digit { width: 42px; height: 50px; font-size: 20px; }
  .code-inputs { gap: 8px; }
  .warn-actions { flex-direction: column; }
}
