:root {
  --bg: #1e3a8a;
  --bg-2: #1e40af;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --text: #e7e9ee;
  --muted: #a3acb9;
  --primary: #3bccdf;
  --primary-600: #14b3cd;
  --ring: rgba(59, 206, 223, 0.45);
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #0f172a;
  display: grid;
  place-items: center;
}

.auth-page {
  position: relative;
  width: min(100%, 1120px);
  padding: clamp(16px, 2.2vw, 32px);
}

.background-decor {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 320px at 30% 0%, rgba(20, 179, 205, 0.18), transparent 60%),
              radial-gradient(700px 360px at 70% 110%, rgba(255, 255, 255, 0.06), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}

.auth-card {
  position: relative;
  margin: 0 auto;
  width: min(100%, 420px);
  padding: clamp(20px, 3vw, 28px);
  border-radius: 18px;
  background: rgba(147, 197, 253, 0.15);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(147, 197, 253, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  width: 100%;
}

.brand-logo {
  width: 200px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 6px;
}

.field label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--muted);
}

.input-wrap input {
  width: 100%;
  padding: 12px 44px 12px 40px;
  border-radius: 12px;
  border: 1px solid var(--surface-strong);
  background: rgba(13, 18, 33, 0.6);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder {
  color: #7c86a2;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background: rgba(13, 18, 33, 0.75);
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toggle-password:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--surface-strong);
}

.toggle-password .eye-off { display: none; }
.toggle-password.revealed .eye { display: none; }
.toggle-password.revealed .eye-off { display: block; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.link {
  color: #84e0ea;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #001319;
  box-shadow: 0 8px 24px rgba(59, 206, 223, 0.35);
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  border-color: var(--surface-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 6px 0 4px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--surface-strong), transparent);
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.foot-note {
  text-align: center;
  color: var(--muted);
  margin-top: 10px;
}

.info-box {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: rgba(59, 206, 223, 0.08);
  border: 1px solid rgba(59, 206, 223, 0.2);
}

.info-box h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-box li {
  margin-bottom: 6px;
}

.info-box li:last-child {
  margin-bottom: 0;
}

.success-message {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 28px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.success-message h3 {
  margin: 0 0 12px 0;
  color: var(--text);
  font-weight: 600;
}

.success-message p {
  margin: 0 0 20px 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 520px) {
  .auth-card { width: 100%; padding: 18px; border-radius: 16px; }
  .brand-sub { font-size: 0.9rem; }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #1e3a8a;
    --bg-2: #1e40af;
    --text: #ffffff;
    --muted: #e2e8f0;
    --surface: rgba(255, 255, 255, 0.1);
    --surface-strong: rgba(255, 255, 255, 0.2);
    --ring: rgba(20, 179, 205, 0.25);
  }

  body { 
    color: var(--text);
    background: #0f172a;
  }
  .auth-card { 
    background: rgba(147, 197, 253, 0.15);
    border: 1px solid rgba(147, 197, 253, 0.3);
  }
  .input-wrap input { 
    background: rgba(147, 197, 253, 0.1);
    color: var(--text);
  }
}