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

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --text-soft: #cbd5e1;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-glow: rgba(225, 29, 72, 0.3);
  --accent: #fb7185;
  --success: #4ade80;
  --input-bg: #0f172a;
  --input-border: #475569;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.brand-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 0 16px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease both;
}

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

.hidden { display: none !important; }

.card-header {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.12);
  border: 2px solid rgba(251, 113, 133, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.icon-circle svg {
  width: 26px;
  height: 26px;
}

.icon-circle.success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.card .desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* ===== FORM ===== */
.field {
  text-align: left;
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field input::placeholder {
  color: #64748b;
}

/* ===== BUTTONS ===== */
.btn {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-top: 4px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #be123c, #e11d48);
}

/* ===== STATUS MESSAGE ===== */
.status-msg {
  font-size: 0.84rem;
  color: #f87171;
  margin-bottom: 12px;
  text-align: left;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== SUCCESS ===== */
.success-text {
  color: var(--success) !important;
}

/* ===== FOOTER ===== */
.footer {
  flex-shrink: 0;
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
}

.footer-brand {
  font-size: 0.75rem;
  color: #475569;
  letter-spacing: 0.5px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 400px) {
  .app { padding: 0 12px 12px; }
  .card { padding: 22px 16px 20px; }
  .card h2 { font-size: 1.05rem; }
  .btn { padding: 13px 14px; font-size: 0.88rem; }
  .topbar-brand span { font-size: 0.82rem; }
}

@media (max-width: 320px) {
  html { font-size: 14px; }
  .app { padding: 0 8px 8px; }
  .topbar { padding: 10px 0 8px; }
  .card { padding: 18px 12px 16px; border-radius: 12px; }
  .card h2 { font-size: 0.98rem; }
  .card .desc { font-size: 0.82rem; margin-bottom: 14px; }
  .field input { padding: 11px 12px; font-size: 0.95rem; }
  .btn { padding: 12px 10px; font-size: 0.82rem; }
  .icon-circle { width: 44px; height: 44px; }
  .icon-circle svg { width: 20px; height: 20px; }
}

@media (min-width: 640px) {
  .app {
    max-width: 520px;
    padding: 0 24px 24px;
  }
  .card {
    padding: 36px 32px 30px;
  }
  .card h2 {
    font-size: 1.3rem;
  }
  .btn {
    padding: 15px 20px;
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  body {
    background:
      radial-gradient(ellipse at 20% 20%, rgba(225, 29, 72, 0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(251, 113, 133, 0.06) 0%, transparent 50%),
      var(--bg);
  }
}

@media (min-width: 1024px) {
  .app {
    max-width: 560px;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .main {
    justify-content: flex-start;
    padding-top: 4px;
  }
  .card {
    padding: 16px 18px 14px;
  }
  .card-header { margin-bottom: 8px; }
  .icon-circle { width: 40px; height: 40px; }
  .icon-circle svg { width: 20px; height: 20px; }
  .card h2 { font-size: 0.98rem; margin-bottom: 6px; }
  .card .desc { font-size: 0.8rem; margin-bottom: 10px; }
  .topbar { padding: 8px 0 4px; }
  .footer { padding: 4px 0 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
