/* ============================================================
   accounts.css — ICS Auth, Profile & Settings
   Mobile-first. Neutral palette, uses design tokens.
   ============================================================ */

/* ── Auth shell ─────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color-scheme: light;
}

.auth-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow: visible;
  padding-bottom: 1.5rem;
}

/* ── Auth card ──────────────────────────────────────────────── */
.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  color-scheme: light;
}

.auth-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 2rem;
}

.auth-card__logo img {
  height: 40px;
  width: auto;
  display: block;
}

.auth-card__tagline {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.auth-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.375rem;
  text-align: center;
}

.auth-card__subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.75rem;
}

.auth-divider {
  width: 32px;
  height: 3px;
  background: var(--primary);
  margin: 0 auto 1.75rem;
  border-radius: 2px;
}

/* ── Auth form fields ───────────────────────────────────────── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  margin-bottom: 1rem;
}

.auth-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.settings-field select,
.settings-field input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: background 0.2s ease-out, border-color 0.2s ease-out;
  cursor: pointer;
}
.settings-field select:focus,
.settings-field input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--primary-alpha);
}

.auth-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  color-scheme: light;
  min-height: 48px;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* ── Error messages ─────────────────────────────────────────── */
.auth-errors {
  background: var(--error-light);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--error-dark);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Auth submit button ─────────────────────────────────────── */
.auth-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  color: var(--button-text);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  text-align: center;
  min-height: 48px;
}
.auth-btn:hover {
  background: var(--primary-button-hover);
}
.auth-btn:active { transform: scale(0.98); }

/* ── Shell ──────────────────────────────────────────────────── */
.accounts-shell {
  min-height: calc(100vh - 56px);
  background: var(--bg);
}

/* ── Tab row (Global account nav) ────────────────────────────── */
.accounts-tab-row {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alpha);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 1rem;
  position: sticky;
  top: 56px;
  z-index: 100;
  scrollbar-width: none;
  gap: 8px;
}
.accounts-tab-row::-webkit-scrollbar { display: none; }
.accounts-tab {
  display: inline-block;
  padding: var(--space-s) var(--space-2xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease-out, color 0.2s ease-out;
  text-decoration: none;
  margin-bottom: -1px;
}
.accounts-tab--active { color: var(--text); border-bottom-color: var(--primary); }

/* ── Content area ───────────────────────────────────────────── */
.accounts-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Standardized spacing between cards */
}

/* ── Profile Hero ────────────────────────────────────────────── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0 0.5rem;
}
.profile-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-hero-name {
  font-size: var(--fz-2);
  font-weight: var(--font-weight-black);
  letter-spacing: var(--tracking-m);
  margin: 0;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
}
.profile-avatar-initials {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 1.75rem;
  font-weight: var(--font-weight-black);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--shadow);
}

/* ── Profile/Settings Cards ─────────────────────────────────── */
.profile-card, .settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.profile-row:last-child { border-bottom: none; }

.profile-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.profile-row-icon {
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
}
.profile-row-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}
.profile-row-value {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  min-width: 0;
}

/* ── Formation Large ────────────────────────────────────────── */
.formation-status-large {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.formation-level-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.formation-level-number {
  font-size: 24px;
  font-weight: var(--font-weight-black);
  line-height: 1;
  color: var(--primary);
}
.formation-level-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}
.formation-details {
  flex: 1;
}
.formation-pathway-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.formation-role-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* ── Membership Item ────────────────────────────────────────── */
.membership-item-standard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.membership-item-standard:last-child { border-bottom: none; }

.membership-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.membership-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.membership-tenant-name {
  font-size: 14px;
  font-weight: 700;
}
.membership-meta-data {
  font-size: 11px;
  color: var(--muted);
}

/* ── Empty state (Handled by standard patterns now) ──────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  width: 100%;
}


/* ── Settings Header ────────────────────────────────────────── */
.settings-section-header {
  margin: -1.25rem -1.25rem 1.25rem;
  padding: 16px 20px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  background: var(--hover);
}
.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

/* ── Form components ────────────────────────────────────────── */
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.settings-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out;
}
.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--hover);
}
.radio-option input[type="radio"] {
  accent-color: var(--primary);
}

.btn-save {
  display: inline-flex;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-save:active { transform: scale(0.98); }

/* ── Save confirm flash ──────────────────────────────────────── */
.save-confirm {
  font-size: 13px;
  color: var(--success-dark);
  background: var(--success-light);
  border-radius: 8px;
  padding: 8px 12px;
  display: inline-block;
  margin-top: 12px;
  animation: fade-out 3s forwards;
}
@keyframes fade-out {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Display Name Edit ───────────────────────────────────────── */
.display-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Auth supplementary ─────────────────────────────────────── */
.auth-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin: -0.75rem 0 1.25rem;
}
.auth-body {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin: 0 0 1rem;
}
.auth-footer {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1.25rem;
}
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer--small { font-size: 0.75rem; }
.auth-card--centered { text-align: center; }
.auth-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.auth-icon {
  font-size: 3rem;
  color: var(--primary);
}
.auth-icon--error { color: var(--error); }
.auth-field__hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============================================================
   Profile Setup Form — scrollable multi-section form
   ============================================================ */

.setup-body {
  background: var(--card);
  min-height: 100vh;
}

.setup-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem;
  background: var(--card);
}

.setup-header {
  text-align: center;
  margin-bottom: 1.5rem;
  max-width: 560px;
  width: 100%;
}
.setup-header__logo {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.setup-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.setup-header p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.setup-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-card);
}

/* Section heading */
.setup-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 2rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.setup-section-title:first-child { margin-top: 0; }

/* Field wrapper */
.setup-field {
  margin-bottom: 1.1rem;
}
.setup-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.setup-field input,
.setup-field select,
.setup-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
.setup-field input:focus,
.setup-field select:focus,
.setup-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.setup-field textarea { resize: vertical; }
.setup-field input[type="file"] {
  padding: 8px 12px;
  min-height: auto;
  cursor: pointer;
}
.setup-field__hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.setup-field__error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 0.3rem;
  display: block;
}
.setup-field--required { color: var(--error); }

/* Two-column row */
.setup-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}
@media (max-width: 480px) {
  .setup-field-row { grid-template-columns: 1fr; }
}

/* Radio groups */
.setup-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.setup-radio-group label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
  margin-bottom: 0;
}
.setup-radio-group label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-tint);
  font-weight: 700;
}
.setup-radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: unset;
  flex-shrink: 0;
  accent-color: var(--primary);
  padding: 0;
  border: none;
  box-shadow: none;
}
.setup-radio-group.setup-inline-radios {
  flex-direction: row;
}
.setup-radio-group.setup-inline-radios label {
  flex: 1;
  justify-content: center;
}

/* Terms checkbox */
.setup-terms {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.125rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--hover);
  margin-top: 2rem;
}
.setup-terms input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}
.setup-terms label {
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  font-weight: 400;
  margin-bottom: 0;
}

/* Submit */
.setup-submit {
  display: block;
  width: 100%;
  padding: 0.9rem;
  margin-top: 1.5rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.setup-submit:hover { opacity: 0.88; }
.setup-submit:active { transform: scale(0.98); }

/* Non-field errors */
.setup-errors {
  background: var(--error-light);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--error-dark);
}

/* Dev-only upload notice */
.setup-dev-notice {
  font-size: 0.75rem;
  color: var(--warning);
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  margin-top: 0.35rem;
  display: inline-block;
}

/* ============================================================
   Welcome screen
   ============================================================ */

.welcome-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--card);
}
.welcome-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.welcome-logo {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 1.25rem;
}
.welcome-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.welcome-card h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.welcome-sub {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}
.kmn-reveal {
  background: var(--primary-tint);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 0 0 1.75rem;
}
.kmn-reveal__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.kmn-reveal__number {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-family: monospace;
}
.kmn-reveal__hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.welcome-steps {
  text-align: left;
  margin: 0 0 1.75rem;
}
.welcome-steps__title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.welcome-step:last-child { border-bottom: none; }
.welcome-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.welcome-step__text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.welcome-step__text span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.welcome-cta {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.welcome-cta:hover { opacity: 0.88; }
.welcome-cta:active { transform: scale(0.98); }
