/* ══════════════════════════════════════════════════════════════════
   Reshu VPN — LK Login Page Styles
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #141323;
  --panel: rgba(255,255,255,.04);
  --text: #eaeaf5;
  --muted: #9a99b8;
  --border: rgba(255,255,255,.08);
  --purple: #7E34FF;
  --purple2: #6523d9;
  --green: #20c997;
  --red: #fa5252;
  --yellow: #fbbf24;
  --r16: 16px;
  --r20: 20px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { height: 100% }
body {
  min-height: 100%;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(126,52,255,.14), transparent 60%),
    radial-gradient(800px 500px at 85% 20%, rgba(0,132,255,.10), transparent 55%),
    radial-gradient(700px 500px at 55% 90%, rgba(126,52,255,.08), transparent 60%);
}
a { color: inherit; text-decoration: none }

.wrap {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 20px 16px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ─── Header ─── */
header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  user-select: none; font-weight: 800;
}
.logo-img { height: 38px; width: auto; border-radius: 10px }
.brand-text { line-height: 1.15 }
.brand-name { font-size: 15px; font-weight: 900; color: #fff }
.brand-name em {
  font-style: normal; color: var(--muted); font-weight: 700;
  font-size: 12px; margin-left: 4px;
  background: rgba(126,52,255,.18); padding: 1px 6px;
  border-radius: 6px; vertical-align: middle;
}
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 600 }
.tg-link {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid rgba(0,136,204,.30);
  background: rgba(255,255,255,.02);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .06s, border-color .15s;
}
.tg-link:hover { border-color: rgba(0,136,204,.55) }
.tg-link:active { transform: scale(.97) }
.tg-link svg { width: 20px; height: 20px; color: rgb(0,136,204) }

/* ─── Card ─── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  border: 1px solid var(--border);
  border-radius: var(--r20); box-shadow: var(--shadow);
  overflow: hidden;
}
.card .in { padding: 24px 20px }

/* ─── Alert ─── */
.alert {
  padding: 12px 16px; border-radius: var(--r16);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
}
.alert-error {
  background: rgba(250,82,82,.1); color: var(--red);
  border: 1px solid rgba(250,82,82,.2);
}

/* ─── Title ─── */
.page-title {
  font-size: 22px; font-weight: 800; margin-bottom: 6px;
  letter-spacing: -.02em;
}
.page-desc {
  color: var(--muted); font-size: 13px; margin-bottom: 20px;
  line-height: 1.6;
}

/* ─── Identifier hint grid ─── */
.id-hint-grid {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-bottom: 18px;
}
.id-hint-item {
  display: flex; align-items: center; gap: 5px;
}
.id-hint-item span {
  font-size: 12px; color: var(--muted); opacity: .65;
}
.id-hint-icon {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--muted); opacity: .45;
}

/* ─── Method Picker Cards ─── */
.method-list {
  display: flex; flex-direction: column; gap: 8px;
}
.method-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--r16);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 14px;
  transition: all .15s; text-align: left; width: 100%;
}
.method-card:hover {
  background: rgba(126,52,255,.08);
  border-color: rgba(126,52,255,.25);
}
.method-card:active { transform: scale(.99) }
.method-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(126,52,255,.12);
  display: grid; place-items: center; flex-shrink: 0;
}
.method-icon svg { width: 20px; height: 20px; color: var(--purple) }
.method-info { flex: 1; min-width: 0 }
.method-label { font-weight: 700; font-size: 15px; margin-bottom: 2px }
.method-desc {
  font-size: 12px; color: var(--muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.method-arrow {
  width: 20px; height: 20px; color: var(--muted);
  flex-shrink: 0; opacity: .5;
}

/* ─── Auth hint ─── */
.auth-hint {
  color: var(--muted); font-size: 14px; margin-bottom: 16px; line-height: 1.6;
}
.auth-hint a {
  color: var(--purple); text-decoration: underline;
  text-decoration-color: rgba(126,52,255,.3);
}
.auth-hint a:hover { text-decoration-color: var(--purple) }
.auth-hint strong { color: var(--text); font-weight: 700 }

/* ─── Form ─── */
.field-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.input-wrap { position: relative }
.input-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  font-size: 15px; font-family: inherit; font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r16); outline: none;
  transition: border-color .2s;
}
.input::placeholder { color: var(--muted); opacity: .6 }
.input:focus { border-color: var(--purple) }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  color: #fff; cursor: pointer;
  border: none; border-radius: var(--r16);
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 4px 20px rgba(126,52,255,.35);
  transition: transform .06s, box-shadow .2s;
}
.btn:hover { box-shadow: 0 6px 28px rgba(126,52,255,.45) }
.btn:active { transform: scale(.98) }
.btn:disabled { opacity: .5; pointer-events: none }
.btn svg { width: 18px; height: 18px }

.btn-secondary {
  background: rgba(255,255,255,.06);
  box-shadow: none;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,.09); box-shadow: none }

.btn-back { gap: 6px }
.btn-back svg { width: 16px; height: 16px; color: var(--muted) }

.error-text {
  color: var(--red); font-size: 13px; font-weight: 500; margin-top: 8px;
}
.form-gap { margin-top: 16px }

/* ─── Code Display ─── */
.code-display {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; margin: 16px 0;
  background: rgba(126,52,255,.08);
  border: 1px solid rgba(126,52,255,.2);
  border-radius: var(--r16);
}
.code-display span {
  font-size: 32px; font-weight: 800; letter-spacing: .2em;
  font-family: 'SF Mono', 'Consolas', monospace; color: #fff;
}
.copy-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s;
}
.copy-btn svg { width: 18px; height: 18px; color: var(--muted) }
.copy-btn:hover { background: rgba(255,255,255,.12) }

/* ─── OTP Code Cells ─── */
.otp-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin: 12px 0 16px;
}
.otp-cell {
  width: 0; flex: 1 1 0; max-width: 48px; height: 54px;
  font-size: clamp(18px, 5vw, 24px); font-weight: 800; font-family: 'SF Mono', 'Consolas', 'Inter', monospace;
  text-align: center; color: #fff;
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--border);
  border-radius: 12px; outline: none;
  caret-color: var(--purple);
  padding: 0;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
.otp-cell::placeholder { color: var(--muted); opacity: .25; font-weight: 400 }
.otp-cell:focus {
  border-color: var(--purple);
  background: rgba(126,52,255,.06);
  box-shadow: 0 0 0 3px rgba(126,52,255,.15);
  transform: scale(1.04);
}
.otp-cell.filled {
  border-color: rgba(126,52,255,.35);
  background: rgba(126,52,255,.06);
}
.otp-cell.error {
  border-color: var(--red);
  background: rgba(250,82,82,.06);
  animation: otp-shake .4s ease;
}
.otp-cell.success {
  border-color: var(--green);
  background: rgba(32,201,151,.08);
}
.otp-dash {
  width: 10px; height: 2.5px; border-radius: 2px;
  background: var(--muted); opacity: .35;
  flex-shrink: 0;
}
.otp-auto-status {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 10px 0;
  font-size: 14px; color: var(--muted);
}
.otp-auto-status .otp-spinner {
  display: block; width: 16px; height: 16px;
  border: 2px solid rgba(126,52,255,.2);
  border-top-color: var(--purple); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes otp-shake {
  0%, 100% { transform: translateX(0) }
  20% { transform: translateX(-6px) }
  40% { transform: translateX(6px) }
  60% { transform: translateX(-4px) }
  80% { transform: translateX(4px) }
}
@media (min-width: 600px) {
  .otp-cell { max-width: 54px; height: 64px; font-size: 28px }
  .otp-wrap { gap: 10px }
}

.timer-text {
  text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 16px;
}

/* ─── Email Steps ─── */
.email-steps {
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 16px;
}
.email-step {
  display: flex; gap: 14px; padding: 12px 0;
  position: relative;
}
.email-step + .email-step { border-top: 1px solid rgba(255,255,255,.04) }
.email-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(126,52,255,.15); color: var(--purple);
  font-size: 13px; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
  margin-top: 2px;
}
.email-step-body { flex: 1; min-width: 0 }
.email-step-title {
  font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.email-step-desc {
  font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 10px;
}
.email-step-desc strong { color: var(--text) }

/* ─── Mail Providers ─── */
.provider-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-bottom: 8px;
}
.provider-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  text-decoration: none; font-family: inherit;
}
.provider-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}
.p-logo {
  width: 28px; height: 28px; border-radius: 7px;
  flex-shrink: 0; object-fit: contain;
}
.p-name { white-space: nowrap }
.mail-fallback { margin-top: 4px }

/* ─── Poll Status ─── */
.poll-status {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; margin-top: 16px;
  background: rgba(32,201,151,.06);
  border: 1px solid rgba(32,201,151,.15);
  border-radius: var(--r16);
  font-size: 14px; color: var(--green);
}
.poll-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1 }
  50% { opacity: .3 }
}

/* ─── Spinner ─── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block }
.btn.loading .btn-text { opacity: .5 }
@keyframes spin { to { transform: rotate(360deg) } }

/* ─── Toast ─── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 12px;
  background: rgba(0,0,0,.85); color: #fff; font-size: 14px;
  pointer-events: none; opacity: 0; transition: opacity .3s;
  z-index: 9999;
}
#toast.show { opacity: 1 }

/* ─── Footer ─── */
footer {
  margin-top: auto; padding: 24px 0 12px; text-align: center;
}
.copy { font-size: 11px; color: var(--muted); opacity: .5 }

/* ─── QR & TOTP Secret (registration) ─── */
.qr-wrap {
  display: flex; justify-content: center; padding: 16px 0;
}
.qr-wrap canvas {
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  padding: 12px;
}
.totp-secret-wrap {
  text-align: center; margin-bottom: 8px;
}
.totp-secret-label {
  font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px;
}
.totp-secret-code {
  font-size: 15px; font-weight: 700; letter-spacing: .08em;
  color: #fff; user-select: all;
  background: rgba(126,52,255,.08);
  padding: 6px 14px; border-radius: 8px;
  display: inline-block;
}

/* ─── Desktop ─── */
@media (min-width: 600px) {
  .wrap { max-width: 520px; padding: 40px 24px }
  .card .in { padding: 32px 28px }
  .page-title { font-size: 26px }
}
