/* ══════════════════════════════════════════════
   TOKEN SYSTEM — LIGHT (Soft Blue)
══════════════════════════════════════════════ */
:root {
  --bg:           #EDF2FB;
  --surface:      #FFFFFF;
  --surface-2:    #F0F4FD;
  --border:       #D6E0F5;
  --border-focus: #4A8CF7;
  --accent:       #3A7BF7;
  --accent-hi:    #2563EB;
  --accent-soft:  rgba(58,123,247,0.12);
  --error:        #DC4B4B;
  --error-soft:   rgba(220,75,75,0.10);
  --success:      #16A34A;
  --text:         #0F172A;
  --text-2:       #334155;
  --muted:        #64748B;
  --muted-2:      #94A3B8;
  --shadow-card:  0 2px 8px rgba(15,23,42,0.06), 0 12px 32px rgba(58,123,247,0.10);
  --shadow-btn:   0 4px 14px rgba(58,123,247,0.38);
  --radius-card:  20px;
  --radius-input: 11px;
  --radius-btn:   11px;
}

/* ══════════════════════════════════════════════
   TOKEN SYSTEM — DARK
══════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:           #0D1424;
  --surface:      #141E35;
  --surface-2:    #1A2744;
  --border:       #243456;
  --border-focus: #5B9BFF;
  --accent:       #5B9BFF;
  --accent-hi:    #7AB4FF;
  --accent-soft:  rgba(91,155,255,0.14);
  --error:        #F87171;
  --error-soft:   rgba(248,113,113,0.12);
  --success:      #4ADE80;
  --text:         #F0F6FF;
  --text-2:       #CBD5E1;
  --muted:        #94A3B8;
  --muted-2:      #64748B;
  --shadow-card:  0 2px 8px rgba(0,0,0,0.3), 0 16px 40px rgba(0,0,0,0.5);
  --shadow-btn:   0 4px 16px rgba(91,155,255,0.30);
}

/* ══════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  transition: background .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow blobs */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 560px; height: 560px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(58,123,247,0.13) 0%, transparent 70%);
}
body::after {
  width: 460px; height: 460px;
  bottom: -140px; left: -90px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
}
[data-theme="dark"] body::before { background: radial-gradient(circle, rgba(91,155,255,0.11) 0%, transparent 70%); }
[data-theme="dark"] body::after  { background: radial-gradient(circle, rgba(91,155,255,0.07) 0%, transparent 70%); }

/* ══════════════════════════════════════════════
   CARD
══════════════════════════════════════════════ */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: card-rise .5s cubic-bezier(.22,1,.36,1) both;
  transition: background .35s, border-color .35s, box-shadow .35s;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top accent stripe */
.card-stripe {
  height: 3px;
  background: linear-gradient(90deg, #3A7BF7 0%, #60A5FA 60%, #93C5FD 100%);
}

/* ══════════════════════════════════════════════
   CARD HERO — banner biru dengan bola melayang
══════════════════════════════════════════════ */
.card-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a6ee8 0%, #3a8ef6 45%, #5eb3ff 100%);
  padding: 36px 32px 32px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Tema toggle di dalam hero — warna putih transparan */
.card-hero .theme-toggle {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.30);
  backdrop-filter: blur(6px);
}
.card-hero .theme-toggle:hover {
  background: rgba(255,255,255,0.30);
  transform: rotate(18deg);
}
.card-hero .theme-toggle svg { stroke: #fff; }
.card-hero .theme-toggle:hover svg { stroke: #fff; }

/* Hero text */
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  font-weight: 400;
  margin-bottom: 6px;
}
.hero-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.60);
  letter-spacing: .2px;
}

/* ── BOLA / ORB ── */
.orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  animation: orb-float linear infinite;
  z-index: 1;
}

.orb-1 { width: 14px; height: 14px; top: 20%;  left: 72%; animation-duration: 7s;  animation-delay: 0s;   }
.orb-2 { width: 10px; height: 10px; top: 55%;  left: 85%; animation-duration: 9s;  animation-delay: -2s;  }
.orb-3 { width: 18px; height: 18px; top: 15%;  left: 55%; animation-duration: 11s; animation-delay: -4s;  }
.orb-4 { width: 8px;  height: 8px;  top: 70%;  left: 60%; animation-duration: 8s;  animation-delay: -1s;  }
.orb-5 { width: 12px; height: 12px; top: 40%;  left: 78%; animation-duration: 10s; animation-delay: -5s;  }

@keyframes orb-float {
  0%   { transform: translateY(0px) scale(1);    opacity: .7; }
  33%  { transform: translateY(-14px) scale(1.1); opacity: 1;  }
  66%  { transform: translateY(-6px) scale(.95);  opacity: .8; }
  100% { transform: translateY(0px) scale(1);    opacity: .7; }
}

/* ══════════════════════════════════════════════
   SECTION HEAD (ganti section-divider di form)
══════════════════════════════════════════════ */
.section-head {
  margin-bottom: 20px;
  padding-top: 2px;
}
.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
  margin-bottom: 4px;
}
.section-desc {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}

.card-body {
  padding: 36px 36px 32px;
}

/* ══════════════════════════════════════════════
   THEME TOGGLE — top right
══════════════════════════════════════════════ */
.theme-toggle {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .2s;
  z-index: 10;
}
.theme-toggle:hover { background: var(--border); transform: rotate(18deg); }
.theme-toggle svg { width: 15px; height: 15px; stroke: var(--muted); transition: stroke .2s; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle:hover svg { stroke: var(--text); }

.icon-sun  { display: block; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ══════════════════════════════════════════════
   LOGO AREA
   Cara pakai logo asli:
   Hapus <div class="logo-placeholder">
   Ganti dengan: <img src="assets/img/logo.png" alt="Shio Store" class="logo-img" />
══════════════════════════════════════════════ */
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 26px;
}

.logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1.5px dashed var(--border-focus);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: background .35s, border-color .35s;
  margin-bottom: 14px;
}

/* Shimmer effect */
.logo-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s ease;
}
.logo-placeholder:hover::after { transform: translateX(100%); }
[data-theme="dark"] .logo-placeholder::after {
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
}

.logo-placeholder .logo-icon {
  font-size: 26px;
  line-height: 1;
}

.logo-placeholder .logo-label {
  font-size: 8px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Real logo image */
.logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 14px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.3px;
}

.brand-tagline {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   SECTION DIVIDER
══════════════════════════════════════════════ */
.section-divider {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.section-divider span {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
  letter-spacing: .4px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════════════ */
.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .05px;
}

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  pointer-events: none;
  stroke: var(--muted-2);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 11px 12px 11px 36px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

input::placeholder { color: var(--muted-2); font-size: 13px; }

input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}

.input-wrap:focus-within .input-icon { stroke: var(--accent); }

input.is-invalid { border-color: var(--error); }
input.is-invalid:focus { box-shadow: 0 0 0 3.5px var(--error-soft); }

.pw-toggle {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  padding: 5px; cursor: pointer;
  color: var(--muted-2);
  display: grid; place-items: center;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.pw-toggle:hover { color: var(--text); background: var(--border); }
.pw-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

#password { padding-right: 40px; }

.field-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  margin-top: 5px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.field-msg.visible { opacity: 1; transform: translateY(0); }
.field-msg.error   { color: var(--error); }
.field-msg.ok      { color: var(--success); }
.field-msg svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   REMEMBER + FORGOT ROW
══════════════════════════════════════════════ */
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: -2px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color .2s, background .2s;
  flex-shrink: 0;
}
.remember input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3.5px; top: 1px;
  width: 5px; height: 8.5px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

.remember span {
  font-size: 12.5px;
  color: var(--muted);
}

a.forgot {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}
a.forgot:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* ══════════════════════════════════════════════
   SUBMIT BUTTON
══════════════════════════════════════════════ */
.btn-submit {
  width: 100%;
  padding: 12.5px;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-btn);
  transition: background .2s, box-shadow .2s, transform .1s, opacity .2s;
  letter-spacing: .15px;
}
.btn-submit:hover  { background: var(--accent-hi); box-shadow: 0 6px 20px rgba(58,123,247,0.45); }
.btn-submit:active { transform: scale(.985); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.loading .btn-spinner { display: block; }
.btn-submit.loading .btn-label   { opacity: .65; }

/* ══════════════════════════════════════════════
   OR DIVIDER + GOOGLE
══════════════════════════════════════════════ */
.or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.or-divider span { font-size: 11.5px; color: var(--muted-2); }

.btn-google {
  width: 100%;
  padding: 11px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background .2s, border-color .2s;
}
.btn-google:hover { background: var(--border); border-color: var(--muted-2); }
.btn-google svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   REGISTER LINK
══════════════════════════════════════════════ */
.register-row {
  text-align: center;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.register-row a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  transition: color .2s;
}
.register-row a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.page-footer {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: .3px;
  text-align: center;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 7px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════
   PWA INSTALL BANNER
══════════════════════════════════════════════ */
#install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1), background .35s, border-color .35s;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
#install-banner.show { transform: translateY(0); }

.install-icon {
  width: 36px; height: 36px;
  background: var(--accent-soft);
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.install-icon svg { width: 17px; height: 17px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.install-text { flex: 1; }
.install-text strong { font-size: 13px; font-weight: 600; display: block; color: var(--text); }
.install-text span   { font-size: 11.5px; color: var(--muted); }

.install-actions { display: flex; gap: 8px; }
.btn-install-do {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.btn-install-do:hover { background: var(--accent-hi); }
.btn-install-skip {
  padding: 8px 12px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
}
.btn-install-skip:hover { background: var(--surface-2); }

/* ══════════════════════════════════════════════
   ACCESSIBILITY & MOTION
══════════════════════════════════════════════ */
:focus-visible {
  outline: 2.5px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 6px;
}

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

@media (max-width: 440px) {
  .card-body { padding: 26px 20px 24px; }
}

/* ══════════════════════════════════════════════
   CLOUDFLARE TURNSTILE
══════════════════════════════════════════════ */
.cf-turnstile {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}

/* Tombol disable saat Turnstile belum selesai */
.btn-submit:disabled:not(.loading) {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  background: var(--muted-2);
}


/* ══════════════════════════════════════════════
   MODAL REGISTER
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 14, 28, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 36px 32px 32px;
  transform: translateY(24px) scale(.97);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.2px;
}
.modal-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 20px;
}


/* ══════════════════════════════════════════════
   FORGOT PASSWORD MODAL EXTRAS
══════════════════════════════════════════════ */
.forgot-success-box {
  text-align: center;
  padding: 20px 0 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.forgot-success-icon {
  width: 48px; height: 48px;
  stroke: #22c55e;
  stroke-width: 2;
  fill: rgba(34,197,94,.12);
  margin-bottom: 12px;
}
.forgot-success-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
#forgot-sent-email {
  font-weight: 600;
  color: #3a8ef6;
  word-break: break-all;
}
