:root {
  --bg: #0a0b0d;
  --surface: rgba(16, 18, 22, 0.94);
  --surface-strong: #151820;
  --surface-muted: #1a1d25;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3efe8;
  --muted: #b0a79c;
  --muted-strong: #d2cbc2;
  --accent: #d39a63;
  --accent-strong: #ebb47d;
  --success: #69c48d;
  --success-soft: rgba(42, 93, 63, 0.30);
  --danger: #f08d7b;
  --danger-soft: rgba(124, 43, 33, 0.34);
  --warning: #e1b165;
  --warning-soft: rgba(103, 74, 24, 0.32);
  --info: #84b6f4;
  --info-soft: rgba(31, 68, 112, 0.30);
  --button: #f3efe8;
  --button-hover: #ffffff;
  --button-text: #101216;
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-sans: "Aptos", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(211, 154, 99, 0.13), transparent 22%),
    radial-gradient(circle at top right, rgba(90, 58, 31, 0.18), transparent 24%),
    linear-gradient(180deg, #0b0c10 0%, #0a0b0d 100%);
}

body.auth-page,
body.verify-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

body.dashboard-page,
body.policy-page,
body.admin-page {
  display: block;
  padding: 32px 20px 56px;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(23, 25, 31, 0.96) 0%, rgba(15, 17, 21, 0.96) 100%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  animation: slideUp 0.45s ease-out;
}

.auth-header {
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-intro {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2 {
  color: var(--text);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
}

h3 {
  color: var(--text);
  letter-spacing: -0.02em;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 0.93rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8f867b;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(235, 180, 125, 0.62);
  box-shadow: 0 0 0 4px rgba(211, 154, 99, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

input[type="text"]:invalid:not(:placeholder-shown),
input[type="email"]:invalid:not(:placeholder-shown),
input[type="password"]:invalid:not(:placeholder-shown) {
  border-color: rgba(240, 141, 123, 0.45);
}

button,
.button-link,
.back-link,
.resend-button,
.btn-secondary,
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover:not(:disabled),
.button-link:hover,
.back-link:hover,
.resend-button:hover,
.btn-secondary:hover,
.btn-logout:hover {
  text-decoration: none;
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.btn-secondary {
  width: auto;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
}

.btn-logout {
  width: auto;
  min-width: 120px;
  background: rgba(240, 141, 123, 0.14);
  color: #f7ddd8;
  border: 1px solid rgba(240, 141, 123, 0.22);
}

.btn-logout:hover:not(:disabled) {
  background: rgba(240, 141, 123, 0.22);
}

.form-footer,
.legal-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.form-footer + .form-footer {
  margin-top: 8px;
}

.policy-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.9rem;
}

.error-message,
.success-message {
  display: none;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.55;
}

.error-message.show,
.success-message.show,
.loading.show,
.field-error.show {
  display: block;
}

.error-message {
  color: #ffd7ce;
  background: var(--danger-soft);
  border-color: rgba(240, 141, 123, 0.18);
}

.error-message a {
  color: #ffe8dd;
  font-weight: 700;
}

.success-message {
  color: #d6f0df;
  background: var(--success-soft);
  border-color: rgba(105, 196, 141, 0.18);
}

.nav-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-buttons a {
  flex: 1;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-weight: 700;
  text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.nav-buttons a.active,
.nav-buttons a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
  text-decoration: none;
}

.loading {
  display: none;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.password-strength {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.password-strength-weak {
  width: 33%;
  background: #cf6d5a;
}

.password-strength-fair {
  width: 66%;
  background: #d6a258;
}

.password-strength-good {
  width: 100%;
  background: #58b37d;
}

.password-requirements {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.requirement {
  display: flex;
  align-items: center;
  margin: 7px 0;
  color: var(--danger);
}

.requirement::before {
  content: '✗';
  margin-right: 10px;
  font-weight: 700;
}

.requirement.met {
  color: var(--success);
}

.requirement.met::before {
  content: '✓';
}

.field-error {
  display: none;
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.88rem;
}

input.error {
  border-color: rgba(240, 141, 123, 0.45);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(22, 24, 29, 0.98);
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s ease-out;
}

.toast.success {
  border-color: rgba(105, 196, 141, 0.20);
  background: rgba(24, 45, 33, 0.98);
  color: #dbf4e4;
}

.toast.error {
  border-color: rgba(240, 141, 123, 0.20);
  background: rgba(63, 28, 22, 0.98);
  color: #ffe0d8;
}

.toast.warning {
  border-color: rgba(225, 177, 101, 0.20);
  background: rgba(57, 42, 18, 0.98);
  color: #f8e3bd;
}

.toast.info {
  border-color: rgba(132, 182, 244, 0.20);
  background: rgba(24, 39, 59, 0.98);
  color: #deebff;
}

.toast::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.toast-close {
  margin-left: auto;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.65;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

.toast.removing {
  animation: slideOutRight 0.3s ease-out;
}

.dashboard,
.admin-container,
.policy-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.dashboard-header,
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.dashboard-welcome,
.admin-header-copy {
  max-width: 720px;
}

.dashboard-welcome h1,
.admin-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2.4rem, 4.8vw, 4rem);
}

.welcome-message,
.admin-subtitle {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.page-directory {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-directory .btn-secondary,
.page-directory .btn-logout,
.dashboard-actions .btn-secondary,
.dashboard-actions .btn-logout {
  width: auto;
}

.dashboard-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.dashboard-card,
.stat-card,
.section-panel,
.modal-content {
  background: linear-gradient(180deg, rgba(21, 23, 29, 0.98) 0%, rgba(15, 17, 21, 0.98) 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.dashboard-card {
  padding: 24px;
}

.dashboard-card h3 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.dashboard-card-content {
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.65;
}

.info-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item strong {
  color: var(--text);
  min-width: 120px;
}

.info-item span {
  color: var(--muted-strong);
  text-align: right;
  word-break: break-word;
}

.badge,
.status-badge,
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-verified,
.status-approved {
  background: rgba(60, 119, 82, 0.26);
  color: #b7e7c9;
  border-color: rgba(125, 205, 155, 0.18);
}

.badge-pending,
.status-pending {
  background: rgba(95, 72, 28, 0.32);
  color: #f1d59d;
  border-color: rgba(225, 177, 101, 0.16);
}

.status-rejected {
  background: rgba(94, 35, 27, 0.34);
  color: #ffc0b3;
  border-color: rgba(240, 141, 123, 0.16);
}

.tier-basic {
  background: rgba(87, 92, 153, 0.24);
  color: #d9ddff;
}

.tier-standard {
  background: rgba(38, 82, 122, 0.24);
  color: #cfe8ff;
}

.tier-premium {
  background: rgba(111, 72, 24, 0.30);
  color: #f4deb1;
}

@media (max-width: 960px) {
  .dashboard-header,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  body.auth-page,
  body.verify-page,
  body.dashboard-page,
  body.policy-page,
  body.admin-page {
    padding: 18px 14px 36px;
  }

  .container {
    padding: 24px 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .dashboard-actions,
  .page-directory,
  .nav-buttons {
    width: 100%;
  }

  .btn-secondary,
  .btn-logout,
  .nav-buttons a,
  .page-directory a {
    width: 100%;
  }

  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-item span {
    text-align: left;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    max-width: none;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
  }
}