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

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --blue:        #0099D6;
  --blue-dark:   #0077A8;
  --blue-light:  #E8F6FC;
  --orange:      #F47920;
  --orange-light:#FEF0E6;
  --bg:          #F0F7FB;
  --bg-card:     #FFFFFF;
  --border:      #D6EEF8;
  --text-1:      #0D2033;
  --text-2:      #4A6478;
  --text-3:      #9BB5C5;
  --success:     #16A34A;
  --error:       #DC2626;
  --warning:     #D97706;
  --radius-md:   14px;
  --radius-lg:   24px;
  --shadow:      0 8px 40px rgba(0,153,214,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --font:        'Inter', 'Syne', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

/* ── Background ─────────────────────────────────────────────── */
.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.orb-1 { width: 500px; height: 500px; background: #BEE5F5; top: -200px; left: -100px; opacity: 0.6; }
.orb-2 { width: 400px; height: 400px; background: #FDDCC4; bottom: -150px; right: -100px; opacity: 0.5; }
.orb-3 { width: 300px; height: 300px; background: #BEE5F5; top: 50%; left: 60%; opacity: 0.3; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 32px; right: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--orange) 100%);
  border-radius: 0 0 4px 4px;
}

/* ── Logo ───────────────────────────────────────────────────── */
.logo-wrap {
  margin-bottom: 28px;
}

.logo-img {
  height: 48px;
  width: auto;
  display: block;
}

/* ── Welcome ────────────────────────────────────────────────── */
.welcome-block { margin-bottom: 20px; }

.welcome-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 26px;
  color: var(--text-1);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.welcome-desc {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── WiFi indicator ─────────────────────────────────────────── */
.wifi-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--blue-light);
  border: 1px solid #C2E5F5;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.wifi-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.bar {
  display: block;
  background: var(--blue);
  border-radius: 2px;
  animation: barPulse 2s ease-in-out infinite;
}

.b1 { width: 3px; height: 4px;  animation-delay: 0s; }
.b2 { width: 3px; height: 7px;  animation-delay: 0.15s; }
.b3 { width: 3px; height: 11px; animation-delay: 0.3s; }
.b4 { width: 3px; height: 15px; animation-delay: 0.45s; }

@keyframes barPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.wifi-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-dark);
}

/* ── Form ───────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.field-inner { position: relative; }

.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-3);
  pointer-events: none;
  transition: color 0.2s;
}

.field-input {
  width: 100%;
  padding: 13px 13px 13px 42px;
  background: #F7FBFD;
  border: 1.5px solid #D6EEF8;
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.12em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.field-input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,153,214,0.12);
}

.field-inner:focus-within .field-icon { color: var(--blue); }

/* ── Button connect ─────────────────────────────────────────── */
.btn-connect {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 18px rgba(0,153,214,0.3);
  -webkit-appearance: none;
}

.btn-connect:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,153,214,0.4);
}

.btn-connect:active { transform: translateY(0); }

.btn-arrow {
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.btn-connect:hover .btn-arrow { transform: translateX(3px); }

.btn-connect.loading .btn-text,
.btn-connect.loading .btn-arrow { opacity: 0; }

.btn-loader {
  display: none;
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-connect.loading .btn-loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Separator ──────────────────────────────────────────────── */
.sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sep-line { flex: 1; height: 1px; background: #E8F0F5; }

.sep-text {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-3);
}

/* ── Free access button ─────────────────────────────────────── */
.btn-free {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--orange-light);
  border: 1.5px solid #F9C49A;
  border-radius: var(--radius-md);
  color: var(--orange);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  margin-bottom: 24px;
}

.btn-free svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-free:hover {
  background: #FDE8D6;
  border-color: var(--orange);
  transform: translateY(-1px);
}

/* ── Footer ─────────────────────────────────────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  padding-top: 16px;
  border-top: 1px solid #EEF5FA;
}

.dot { opacity: 0.5; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 14px;
  animation: alertIn 0.3s ease both;
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error   { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #B45309; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Success screen ─────────────────────────────────────────── */
.success-screen { text-align: center; padding: 8px 0; }

.success-icon {
  width: 64px; height: 64px;
  background: #F0FDF4;
  border: 2px solid #BBF7D0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes successPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-icon svg { width: 28px; height: 28px; color: var(--success); }

.success-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-1);
}

.success-msg {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
}

.success-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  background: var(--blue-light);
  border: 1px solid #C2E5F5;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  gap: 3px;
}

.meta-chip strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
}

.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--success) 0%, #15803D 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(22,163,74,0.25);
}

.btn-browse:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(22,163,74,0.35);
}

.countdown {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 12px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 12px; align-items: flex-start; padding-top: 20px; }
  .card { padding: 28px 20px 22px; }
  .welcome-title { font-size: 22px; }
}

@media (max-width: 360px) {
  .card { padding: 22px 14px 18px; }
  .success-meta { flex-direction: column; align-items: center; }
}

/* ── Error screen ───────────────────────────────────────────── */
.error-screen { text-align: center; padding: 8px 0; }

.error-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.error-icon svg { width: 28px; height: 28px; }

.error-icon--red {
  background: #FEF2F2;
  border: 2px solid #FECACA;
  color: #DC2626;
}

.error-icon--orange {
  background: #FEF0E6;
  border: 2px solid #F9C49A;
  color: var(--orange);
}

.error-icon--blue {
  background: var(--blue-light);
  border: 2px solid #C2E5F5;
  color: var(--blue-dark);
}

.error-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--text-1);
}

.error-msg {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.error-tips {
  background: #F7FBFD;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 24px;
}

.tips-title {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.error-tips ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.error-tips ul li {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.error-tips ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-size: 11px;
}

.error-tips ul li strong {
  font-weight: 700;
  color: var(--text-1);
}

/* ── Back button ────────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0,153,214,0.25);
}

.btn-back svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-back:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,153,214,0.35);
}

/* ── Button group ───────────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-free-sm {
  display: inline-flex;
  align-items: center;
  padding: 13px 20px;
  background: var(--orange-light);
  border: 1.5px solid #F9C49A;
  border-radius: var(--radius-md);
  color: var(--orange);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-free-sm:hover {
  background: #FDE8D6;
  border-color: var(--orange);
  transform: translateY(-1px);
}

