@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --card: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #818cf8;
  --accent-dark: #6366f1;
  --error: #fca5a5;
  --success: #6ee7b7;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .4;
}

body::before { width: 500px; height: 500px; top: -150px; right: -100px; background: #6366f1; }
body::after { width: 400px; height: 400px; bottom: -100px; left: -80px; background: #ec4899; }

.auth-card {
  width: min(100%, 420px);
  padding: 40px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.wide-card, .profile-card { width: min(100%, 720px); }
h1 { margin: 0 0 6px; font-size: 1.75rem; line-height: 1.2; }
.subtitle { margin: 0 0 28px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.centered { text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.full-width { grid-column: 1 / -1; }
.form-group { position: relative; margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #cbd5e1; font-size: .8rem; font-weight: 500; letter-spacing: .02em; }

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.form-group input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 3px rgba(129, 140, 248, .15); }
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 66px; }
.toggle-password { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); padding: 6px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: .78rem; cursor: pointer; }

.primary-btn, .secondary-btn {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.primary-btn { background: linear-gradient(135deg, var(--accent-dark), #8b5cf6); }
.secondary-btn { border: 1px solid var(--border); background: rgba(255, 255, 255, .07); }
.primary-btn:hover, .secondary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, .25); }
.button-link { display: block; text-align: center; text-decoration: none; }
.switch-text { margin: 26px 0 0; text-align: center; color: #64748b; font-size: .875rem; }
a { color: var(--accent); font-weight: 500; }
.hint { margin: -8px 0 20px; color: var(--muted); font-size: .76rem; }

.alert { margin-bottom: 22px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: .86rem; line-height: 1.5; }
.alert ul { margin: 0; padding-left: 20px; }
.alert-error { border-color: rgba(248, 113, 113, .35); background: rgba(127, 29, 29, .28); color: var(--error); }
.alert-success { border-color: rgba(52, 211, 153, .3); background: rgba(6, 78, 59, .28); color: var(--success); }
.otp-input { text-align: center; font-size: 1.55rem !important; font-weight: 700 !important; letter-spacing: .45em; }
.status-icon { width: 58px; height: 58px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; font-size: 1.8rem; font-weight: 700; }
.status-success { background: rgba(52, 211, 153, .16); color: var(--success); }
.status-error { background: rgba(248, 113, 113, .16); color: var(--error); }
.status-icon + h1 { text-align: center; }

.profile-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.profile-heading .subtitle { margin: 0; }
.avatar { width: 62px; height: 62px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--accent-dark), #8b5cf6); font-size: 1.2rem; font-weight: 700; }
.profile-list { margin: 0 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-list div { padding: 16px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .035); overflow-wrap: anywhere; }
.profile-list dt { margin-bottom: 6px; color: var(--muted); font-size: .75rem; }
.profile-list dd { margin: 0; font-size: .95rem; }

@media (max-width: 600px) {
  body { align-items: flex-start; }
  .auth-card { padding: 32px 24px; border-radius: 16px; }
  .form-grid, .profile-list { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .profile-heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
