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

/* ── Auth shell ─────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  background: #f2f2f2;
  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;
  /* Override global.css main rules not applicable to auth pages */
  overflow: visible;
  padding-bottom: 1.5rem;
}

/* ── Auth card ──────────────────────────────────────────────── */
.auth-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
  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: #222222;
  margin: 0 0 1.5rem;
  text-align: center;
}

/* ── Auth form fields ───────────────────────────────────────── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

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

.auth-field input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #222222;
  font-size: 0.9375rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  /* Force light appearance so OS dark mode doesn't override native controls */
  color-scheme: light;
}

.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: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #991b1b;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-field__error {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.125rem;
}

/* ── Auth submit button ─────────────────────────────────────── */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s;
  font-family: inherit;
  text-align: center;
}

.auth-btn:hover {
  background: var(--primary-button-hover) !important;
}

/* ── Footer link ────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

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

/* ── Tab row ────────────────────────────────────────────────── */
.accounts-tab-row {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  padding: 0 0.5rem;
  position: sticky;
  top: 56px;
  z-index: 100;
  scrollbar-width: none;
}
.accounts-tab-row::-webkit-scrollbar { display: none; }
.accounts-tab {
  display: inline-block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.accounts-tab:hover { color: var(--primary); }
.accounts-tab--active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Content area ───────────────────────────────────────────── */
.accounts-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0 1rem;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.profile-avatar-initials {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Info card ──────────────────────────────────────────────── */
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.125rem;
}
.profile-card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.profile-row:last-child { border-bottom: none; }
.profile-row-label {
  font-size: 0.8125rem;
  color: var(--muted);
  flex-shrink: 0;
}
.profile-row-value {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: right;
}
.profile-row-action {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 0.25rem;
  font-size: 0.875rem;
}

/* ── Status badge ───────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge--active   { background: #d1fae5; color: #065f46; }
.status-badge--seeker   { background: #dbeafe; color: #1e3a8a; }
.status-badge--suspended { background: #fee2e2; color: #991b1b; }
.status-badge--pending_verification { background: #fef9c3; color: #92400e; }

/* ── Formation level ────────────────────────────────────────── */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.level-number {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Membership list ────────────────────────────────────────── */
.membership-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.membership-item:last-child { border-bottom: none; }
.membership-tenant { font-size: 0.875rem; font-weight: 600; }
.membership-meta   { font-size: 0.75rem; color: var(--muted); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Settings sections ──────────────────────────────────────── */
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.settings-section-header {
  padding: 0.875rem 1.125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}
.settings-section-body {
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* ── Form controls in settings ──────────────────────────────── */
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.settings-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}
.settings-field select,
.settings-field input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}
.settings-field select:focus,
.settings-field input[type="text"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ── Radio group ────────────────────────────────────────────── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.radio-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.radio-option span.disabled-label {
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Save button ─────────────────────────────────────────────── */
.btn-save {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}
.btn-save:hover { background: var(--primary-button-hover); }

/* ── Inline edit ─────────────────────────────────────────────── */
.inline-edit-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-edit-form input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}
.inline-edit-form input[type="text"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.btn-inline-save {
  padding: 0.375rem 0.875rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-inline-cancel {
  padding: 0.375rem 0.625rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Save confirm flash ──────────────────────────────────────── */
.save-confirm {
  font-size: 0.8125rem;
  color: #065f46;
  background: #d1fae5;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  display: inline-block;
  animation: fade-out 2.5s forwards;
}
@keyframes fade-out {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Inline name display ─────────────────────────────────────── */
.display-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
