/* ============================================================
   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: 16px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  color-scheme: light;
}

.auth-card__brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-card__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.auth-card__tagline {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.auth-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1.5rem;
  text-align: center;
}

/* ── 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: 12px;
  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: 44px;
}

.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;
}
