/* LinkID - Thin Soft Minimalism */

/* Karasuma Gothic Font */
@import 'fonts.css?v=1789071365953';
@import 'themes.css?v=1789071365953';   /* per-theme vars, generated from config.THEMES (single source) */

:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #86868b;
  /* --color-primary / --color-primary-hover come from themes.css (per-theme accent) */
  --color-border: #d2d2d7;
  --color-border-light: #e8e8ed;
  --color-error: #ff3b30;
  --color-success: #34c759;
  /* surfaces referenced by oauth/permission UIs (were undefined → colors fell through) */
  --color-bg-secondary: #f5f5f7;
  --color-bg-tertiary: #e8e8ed;
  /* single unified danger red */
  --color-danger: #ff3b30;
  /* brand gradients: header keeps the deep blue; brand is the blue→indigo signature */
  /* --gradient-header now comes from themes.css (per-theme banner) */
  --gradient-brand: linear-gradient(135deg, #0a84ff 0%, #3a37d4 100%);
  /* type scale */
  --fs-display: 30px;
  --fs-h1: 22px;
  --fs-h2: 17px;
  --fs-body: 15px;
  --fs-label: 13px;
  --fs-cap: 12px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --transition: 0.2s ease;
  /* --focus-ring comes from themes.css (per-theme) */
  /* Frosted-glass surface tokens (theme-agnostic) */
  --glass-card-bg: rgba(255, 255, 255, 0.62);
  --glass-nav-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-blur: blur(24px) saturate(180%);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-input-bg: rgba(255, 255, 255, 0.7);
  --glass-divider: rgba(120, 120, 128, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'KarasumaGothic', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 900px;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 0 48px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.header .logo {
  margin-bottom: 0;
  text-align: left;
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--color-text);
  text-decoration: none;
  display: block;
}

.logo:hover {
  opacity: 0.8;
}

.tagline {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.page-center {
  justify-content: center;
}

.page-center .logo {
  text-align: center;
  margin-bottom: 8px;
}

/* Card */
.card {
  background: var(--glass-card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 28px;
  border: 1px solid var(--glass-border);
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: -0.2px;
}

/* Form */
.form-group {
  margin-bottom: 18px;
}

.form-group:last-of-type {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--glass-input-bg);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.form-checkbox-label input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Scope checklist (admin app modal) */
.scope-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.scope-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.scope-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.scope-check .scope-code {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-tertiary, var(--color-text-secondary));
  opacity: 0.7;
}

/* Show/hide password toggle (injected by password-toggle.js) */
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap .form-input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover {
  color: var(--color-text);
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.form-input::placeholder {
  color: var(--color-text-secondary);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

/* Informational note inside a form (e.g. "changing your password signs you out elsewhere") */
.revoke-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.revoke-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* Calm press feedback for all buttons — a slight dim, no vertical movement */
.btn:active:not(:disabled) {
  filter: brightness(0.95);
}

/* Keyboard focus ring (only on Tab, not mouse clicks) */
.btn:focus-visible,
.link:focus-visible,
.logo:focus-visible,
.card-footer a:focus-visible,
.footer-links a:focus-visible,
.profile-nav-item:focus-visible,
.avatar-edit-btn:focus-visible,
.password-toggle:focus-visible,
.user-badge-appeal:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-primary:disabled {
  background: #a8d4ff;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.btn-small {
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

.btn-danger {
  background: var(--color-error);
  color: white;
  width: auto;
}

.btn-danger:hover {
  background: #e6342b;
}

/* Links */
.link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
}

.link:hover {
  text-decoration: underline;
}

.card-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.card-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.card-footer a:hover {
  text-decoration: underline;
}

/* Messages */
.message {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
}

.message-error {
  background: #fff2f1;
  color: var(--color-error);
  border: 1px solid #ffccc9;
}

.message-success {
  background: #f0fff4;
  color: #1a7f37;
  border: 1px solid #b7f5c5;
}

.message-info {
  background: #f0f7ff;
  color: var(--color-primary);
  border: 1px solid #b3d7ff;
}

/* Recovery Code Display */
.recovery-code-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 24px;
  margin: 24px 0;
  text-align: center;
}

.recovery-code-label {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.recovery-code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #78350f;
  user-select: all;
  padding: 8px 0;
}

.recovery-code-warning {
  font-size: 13px;
  color: #b45309;
  margin-top: 16px;
  line-height: 1.5;
}

.recovery-code-display {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 16px 0;
  text-align: center;
}

.recovery-code-display p {
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
}

.recovery-code-display .recovery-code {
  display: block;
  margin-bottom: 16px;
}

/* Actions row */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.actions .btn {
  flex: 1;
}

/* Landing page */
.hero {
  text-align: center;
  padding: 80px 0 40px;
}

.hero-title {
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -1px;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  width: auto;
  min-width: 140px;
  padding: 12px 28px;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Loading */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Profile Page - Microsoft-inspired Design */
.profile-page {
  width: 100%;
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 24px;
}

.profile-header-card {
  position: relative;
  width: 100%;
  background: var(--gradient-header);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  border: 3px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-btn-light {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
}

.avatar-edit-btn-light:hover {
  background: white;
  border-color: white;
  color: var(--color-primary);
}

.profile-header-info {
  flex: 1;
}

.profile-header-info h1 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.profile-header-info .profile-username {
  font-size: 15px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.profile-header-info .profile-meta {
  font-size: 13px;
  opacity: 0.7;
}

.profile-header-actions {
  display: flex;
  gap: 12px;
}

.profile-header-actions .btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: auto;
  backdrop-filter: blur(10px);
}

.profile-header-actions .btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Profile Navigation Tabs */
.profile-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--glass-nav-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
}

.profile-nav-item {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.profile-nav-item:hover {
  color: var(--color-text);
  background: rgba(120, 120, 128, 0.1);
}

.profile-nav-item.active {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Profile Sections */
.profile-section {
  display: none;
  animation: fadeIn 0.2s ease;
}

.profile-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile Cards */
.profile-card {
  width: 100%;
  background: var(--glass-card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
  overflow: hidden;
}

.profile-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.profile-card-body {
  padding: 24px;
}

.profile-card-body:empty {
  padding: 0;
}

/* Avatar Edit Button */
.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-edit-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Theme edit — palette button on the banner + swatch popover (mirrors avatar edit) */
.theme-edit-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-edit-btn:hover { background: #fff; color: var(--color-primary); }
.theme-popover {
  position: absolute;
  top: 56px;
  right: 16px;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--glass-card-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.theme-popover.open { display: flex; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.appearance-swatches { display: flex; gap: 10px; padding: 16px 24px 20px; }

/* Settings Row */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:hover {
  background: var(--color-bg);
}

.settings-row-info {
  flex: 1;
}

.settings-row-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.settings-row-info p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.settings-row-value {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-right: 16px;
}

.settings-row-action {
  flex-shrink: 0;
}

/* Profile Form */
.profile-form {
  padding: 24px;
}

.profile-form h3 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-input {
  flex: 1;
}

.form-row .btn {
  width: auto;
  flex-shrink: 0;
}

/* Sessions List */
.sessions-list,
.apps-list {
  display: flex;
  flex-direction: column;
}

.session-item,
.app-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition);
}

.session-item:last-child,
.app-item:last-child {
  border-bottom: none;
}

.session-item:hover,
.app-item:hover {
  background: var(--color-bg);
}

.session-current-item {
  background: rgba(16, 185, 129, 0.05);
}

.session-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.session-device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-bg);
  border-radius: 12px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.session-device-icon svg {
  width: 24px;
  height: 24px;
}

.session-item:hover .session-device-icon {
  background: var(--color-border);
  color: var(--color-text);
}

.session-current-item .session-device-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.session-current-item:hover {
  background: rgba(16, 185, 129, 0.09);
}

.session-current-item:hover .session-device-icon {
  background: rgba(16, 185, 129, 0.22);
  color: var(--color-success);
}

.session-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-device {
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.session-ip::after {
  content: '•';
  margin-left: 8px;
  color: var(--color-text-tertiary);
}

.session-meta span:last-child::after {
  display: none;
}

.session-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.session-current-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-success);
  background: #ecfdf3;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.session-oauth-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.session-oauth-item .session-device-icon {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.session-oauth-item:hover .session-device-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary);
}

.session-terminate-btn {
  flex-shrink: 0;
}

.session-info,
.app-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-date,
.app-name {
  font-weight: 500;
  font-size: 14px;
}

.session-current {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-success);
  background: #ecfdf3;
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
}

.app-date {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Danger Zone */
.profile-card.danger-zone {
  border-color: #fecaca;
}

.profile-card.danger-zone .profile-card-header {
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

.profile-card.danger-zone .profile-card-header h3 {
  color: var(--color-error);
}

.danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border-light);
  gap: 16px;
}

.danger-item:last-child {
  border-bottom: none;
}

.danger-info {
  flex: 1;
}

.danger-info h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  color: var(--color-text);
}

.danger-info p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-content {
  max-width: 380px;
  width: 100%;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h3 {
  font-size: 17px;
  margin-bottom: 8px;
  text-align: center;
}

.modal-content p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.geo-country {
  text-align: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* "Trust this location" opt-in on the TOTP screen (shown only for a new country) */
.totp-trust {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}
.totp-trust .geo-country {
  margin-bottom: 12px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* Admin page */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-app-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.admin-app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-app-actions .btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Legal pages */
.legal-content {
  line-height: 1.7;
}

.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--color-text);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.legal-content ul {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--color-text-secondary);
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content strong {
  color: var(--color-text);
}

.legal-date {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 0;
  margin-top: auto;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .profile-page {
    padding: 0 16px;
  }

  .profile-header-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .profile-header-info h1 {
    font-size: 22px;
  }

  .profile-header-actions {
    width: 100%;
    justify-content: center;
  }

  .profile-nav {
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .profile-nav::-webkit-scrollbar { display: none; }

  .profile-nav-item {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: 13px;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .settings-row-value {
    margin-right: 0;
  }

  .settings-row-action {
    width: 100%;
  }

  .settings-row-action .btn {
    width: 100%;
  }

  .session-item,
  .app-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }

  .session-main {
    width: 100%;
  }

  .session-terminate-btn,
  .session-item .btn-small,
  .app-item .btn-small {
    width: 100%;
  }

  .danger-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .danger-item .btn-danger {
    width: 100%;
  }

  .profile-card-header {
    padding: 16px 20px;
  }

  .profile-card-body {
    padding: 20px;
  }

  .profile-form {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .card {
    padding: 24px 20px;
  }

  .hero {
    padding: 60px 0 32px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-buttons {
    flex-direction: column;
    padding: 0 20px;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .recovery-code {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .btn {
    width: 100%;
  }

  .header {
    margin-bottom: 24px;
  }

  .profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }

  .profile-nav-item {
    padding: 10px 12px;
  }
}

/* ── Utility spacing ── */
.message-spaced {
  margin-top: 8px;
}

.btn-spaced {
  margin-top: 16px;
}

.recovery-code-input {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── Admin page additions ── */
.header-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-header .card-title {
  margin-bottom: 0;
}

.card-spaced {
  margin-top: 24px;
}

/* App secret modal (blue variant of recovery-code-box) */
.recovery-code-box.secret-variant {
  background: #f0f7ff;
  border-color: #b3d7ff;
}

.recovery-code-box.secret-variant .recovery-code-label {
  color: var(--color-primary);
}

.recovery-code-box.secret-variant .recovery-code {
  color: var(--color-text);
  font-size: 14px;
  letter-spacing: 0;
}

/* User badges (admin user list) */
.user-badges-row {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.user-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.user-badge-admin {
  color: var(--color-primary);
  background: rgba(0, 113, 227, 0.08);
}

.user-badge-banned {
  color: var(--color-danger);
  background: rgba(255, 59, 48, 0.08);
}

.user-badge-appeal {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  cursor: pointer;
  transition: background var(--transition);
}

.user-badge-appeal:hover {
  background: rgba(245, 158, 11, 0.18);
}

/* Appeal modal (admin view) */
.appeal-display-box {
  white-space: pre-wrap;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: 16px;
}

.appeal-prev-response {
  padding: 10px 12px;
  background: rgba(0, 113, 227, 0.04);
  border: 1px solid rgba(0, 113, 227, 0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

.appeal-prev-response-label {
  color: var(--color-primary);
}

/* Two-factor (TOTP) */
.twofa-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.twofa-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.twofa-pill-on { background: #e7f8ec; color: #1a7f37; }
.twofa-pill-off { background: #f1f1f4; color: #86868b; }

.twofa-setup {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.twofa-qr-box {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  flex: 0 0 auto;
}
.twofa-qr-box img {
  display: block;
  width: 150px;
  height: 150px;
}
.twofa-setup-info {
  flex: 1;
  min-width: 200px;
}
.twofa-setup-info p {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.secret-box {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 10px 12px;
  text-align: center;
  user-select: all;
  word-break: break-all;
}
.twofa-code-input {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
  text-align: center;
}
