* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --input-bg: rgba(255, 255, 255, 0.08);
  --input-focus: rgba(255, 255, 255, 0.16);
  --card-bg: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.14);
  --btn-bg: rgba(255, 255, 255, 0.10);
  --btn-hover: rgba(255, 255, 255, 0.22);
  --primary: #59c3ff;
  --primary-glow: rgba(89, 195, 255, 0.35);
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text);
  background: #071122;
  overflow: hidden;
}

/* ── Brand block ── */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 0 32px rgba(89,195,255,0.30), 0 8px 24px rgba(0,0,0,0.35);
  border: 1px solid rgba(89,195,255,0.22);
}

.brand-title  { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.brand-subtitle { font-size: 12px; color: var(--muted); opacity: 0.7; }

/* ── Scroll variant for register ── */
.auth-stage--scroll {
  overflow-y: auto;
  align-items: flex-start;
  padding-top: 30px;
  padding-bottom: 30px;
}
.auth-stage--scroll body { overflow: auto; }

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top left, rgba(20, 55, 110, 0.45), transparent 32%),
    radial-gradient(circle at top right, rgba(16, 83, 145, 0.35), transparent 30%),
    linear-gradient(135deg, rgba(5, 13, 26, 0.76), rgba(8, 22, 46, 0.74), rgba(12, 40, 78, 0.70));
  backdrop-filter: blur(1px);
}

/* ── Stage ── */
.auth-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-stage--scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Card ── */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  border-radius: 30px;
  padding: 22px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 30px 70px rgba(0,0,0,0.40),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  animation: floatCard 5s ease-in-out infinite;
}

.auth-card-register { max-width: 500px; }

.auth-glow {
  position: absolute;
  inset: -1px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(89,195,255,0.18), transparent 35%, transparent 70%, rgba(89,195,255,0.10));
  pointer-events: none;
  opacity: 0.8;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ── Top ── */
.auth-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.back-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  font-size: 24px;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255,255,255,0.20);
}

.brand-box { display: flex; flex-direction: column; }

/* ── Content ── */
.auth-content { position: relative; z-index: 1; }

.auth-badge {
  display: inline-flex;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.auth-content h1 {
  font-size: 36px;
  margin-bottom: 10px;
  text-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.auth-desc {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 26px;
}

/* ── Alert ── */
.auth-alert {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 80, 80, 0.30);
  color: #ffaaaa;
}

.auth-alert--success {
  background: rgba(80, 220, 120, 0.15);
  border-color: rgba(80, 220, 120, 0.30);
  color: #aaffcc;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 14px;
  color: rgba(255,255,255,0.88);
}

.input-group input {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--border);
  outline: none;
  padding: 0 16px;
  color: #fff;
  background: var(--input-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: 0.2s ease;
  font-size: 15px;
}

.input-group input::placeholder { color: rgba(255,255,255,0.45); }

.input-group input:focus {
  background: var(--input-focus);
  border-color: rgba(89, 195, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(89, 195, 255, 0.08);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }

.toggle-password {
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0.08);
  transition: 0.2s ease;
}

.toggle-password:hover { background: rgba(255,255,255,0.18); }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.remember-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.remember-box input { accent-color: var(--primary); }

.form-link {
  color: #9bdcff;
  text-decoration: none;
  font-size: 14px;
}

.form-link:hover { text-decoration: underline; }

/* ── Buttons ── */
.auth-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, rgba(89,195,255,0.35), rgba(89,195,255,0.18));
  box-shadow: 0 10px 22px rgba(89, 195, 255, 0.18);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(89, 195, 255, 0.25);
}

.secondary-btn {
  background: var(--btn-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.secondary-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* ── Divider ── */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 22px 0 18px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 1px;
  background: rgba(255,255,255,0.10);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(11, 24, 47, 0.65);
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .auth-stage { padding: 14px; }

  .auth-card,
  .auth-card-register {
    max-width: 100%;
    padding: 18px;
    border-radius: 24px;
  }

  .brand-title { font-size: 24px; }
  .auth-content h1 { font-size: 30px; }
  .auth-desc { font-size: 15px; }
  .input-group input, .auth-btn { height: 50px; }
}
