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

:root {
  --primary: #F27A1A;
  --primary-dark: #c96010;
  --primary-glow: rgba(242, 122, 26, 0.25);
  --bg: #0a0a0c;
  --bg-2: #111115;
  --bg-3: #18181c;
  --border: rgba(255,255,255,0.08);
  --text: #f0f0f0;
  --text-muted: #888899;
  --text-dim: #444455;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  /* Subtle gradient bg */
  background:
    radial-gradient(ellipse at 30% 20%, rgba(242,122,26,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(59,130,246,0.05) 0%, transparent 50%),
    var(--bg);
}

/* ─── Card ─────────────────────────────────────────────────────────── */
.portal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-card-header {
  padding: 32px 32px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(242,122,26,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), #ff9d4a);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 14px;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.portal-card-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.portal-card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.portal-card-body {
  padding: 28px 32px 32px;
}

/* ─── 6-digit Code Input ──────────────────────────────────────────── */
.code-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.digit-input {
  width: 52px; height: 60px;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  font-family: 'Inter', monospace;
  outline: none;
  transition: all 0.2s;
  caret-color: var(--primary);
}

.digit-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: rgba(242,122,26,0.05);
}

.digit-input.filled {
  border-color: rgba(242,122,26,0.4);
}

/* ─── Phone Input ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrap {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="tel"] {
  width: 100%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 40px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
}

input[type="tel"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

input[type="tel"]::placeholder { color: var(--text-dim); }

/* ─── Button ────────────────────────────────────────────────────────── */
.btn-portal {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #ff9d4a);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-portal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow);
}

.btn-portal:active { transform: translateY(0); }
.btn-portal:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Messages ──────────────────────────────────────────────────────── */
.message {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 14px;
  display: none;
}

.message.error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  display: block;
}

.message.success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  display: block;
}

/* ─── Spinner ───────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ────────────────────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px; }
  .portal-card-header, .portal-card-body { padding-left: 20px; padding-right: 20px; }
  .digit-input { width: 44px; height: 52px; font-size: 20px; }
}
