* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0d14;
  font-family: 'Inter', sans-serif;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* Prevent iOS auto-zoom on input focus */
input, textarea, select { font-size: 16px; }

/* All interactive get manipulation touch-action */
a, button, [onclick] { touch-action: manipulation; }

.back-home {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  left: 16px;
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
  z-index: 10;
  padding: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.auth-page {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}

.auth-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hidden { display: none !important; }

/* ── LOGO ── */
.brand-logo { margin-bottom: 16px; }

.logo-circle {
  width: 120px;
  height: 120px;
  background: #0d0d1a;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.logo-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px;
}

.crown      { font-size: 22px; color: #c9a227; line-height: 1; }
.fp-text    { font-size: 28px; font-weight: 900; color: #c9a227; font-family: 'Cinzel', serif; line-height: 1; }
.fortune-text {
  font-size: 13px;
  color: #c9a227;
  text-align: center;
  line-height: 1.3;
  font-style: italic;
}
.fortune-text em { color: #a0522d; font-style: italic; }

/* ── BRAND NAME ── */
.brand-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  margin-bottom: 20px;
}

/* ── TITLES ── */
.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.2;
}

.welcome-sub {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 28px;
  text-align: center;
  line-height: 1.5;
}

/* ── FORM ── */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.field-group {
  position: relative;
  display: flex;
  align-items: center;
}

.field-group input {
  width: 100%;
  background: #111827;
  border: 1.5px solid #1f2937;
  border-radius: 14px;
  padding: 15px 52px 15px 48px;
  color: #fff;
  font-size: 16px; /* 16px prevents iOS auto-zoom */
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  font-family: 'Inter', sans-serif;
  min-height: 54px;
  -webkit-appearance: none;
  appearance: none;
}

.field-group input:focus {
  border-color: #c9a227;
  background: #1a2234;
}

.field-group input::placeholder { color: #4b5563; }

.field-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
  color: #c9a227;
  filter: saturate(0.7);
}

.eye-btn {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 44px touch target */
  width: 48px;
  height: 54px;
  opacity: 0.6;
  touch-action: manipulation;
}
.eye-btn:active { opacity: 1; }

/* ── BUTTONS ── */
.btn-signin {
  width: 100%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 17px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(34,197,94,0.35);
  min-height: 54px;
  transition: transform 0.1s, box-shadow 0.1s;
  margin-top: 4px;
  touch-action: manipulation;
  -webkit-appearance: none;
}
.btn-signin:active {
  transform: scale(0.97);
  box-shadow: 0 2px 12px rgba(34,197,94,0.25);
}

.forgot-link {
  color: #c9a227;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 24px;
  padding: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.no-account {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 12px;
}

.btn-create {
  background: #1a2234;
  border: 1.5px solid #2d3748;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  touch-action: manipulation;
  -webkit-appearance: none;
  transition: background 0.1s, transform 0.1s;
}
.btn-create:active {
  background: #243048;
  transform: scale(0.97);
}

.btn-icon { font-size: 16px; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: max(32px, calc(16px + env(safe-area-inset-bottom, 0px)));
  left: 16px;
  right: 16px;
  transform: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  z-index: 999;
  animation: toastIn 0.25s cubic-bezier(.34,1.56,.64,1);
  text-align: center;
}

.toast.error   { background: #7f1d1d; color: #fca5a5; border: 1px solid #ef4444; }
.toast.info    { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f6; }
.toast.success { background: #14532d; color: #86efac; border: 1px solid #22c55e; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── RESPONSIVE ── */
@media (max-width: 390px) {
  .auth-page { padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .welcome-title { font-size: 24px; }
  .logo-circle { width: 90px; height: 90px; }
  .brand-name { font-size: 13px; letter-spacing: 2px; }
  .welcome-sub { font-size: 13px; margin-bottom: 20px; }
  .field-group input { padding: 13px 48px 13px 44px; min-height: 50px; }
}
