/* assets/css/style.css */
/* Virtual Showroom Ciputat - Gate flow stylesheet */
/* Tema: dark luxury automotive, senada sama redesign tunastoyotaciputat.com */

:root {
  /* ---- Warna ---- */
  --color-bg: #0a0a0a;
  --color-bg-elevated: #141414;
  --color-bg-card: #17171a;
  --color-red: #eb0a1e;
  --color-red-dim: #a3081a;
  --color-red-glow: rgba(235, 10, 30, 0.35);
  --color-text: #f5f5f5;
  --color-text-dim: #9a9a9a;
  --color-border: rgba(255, 255, 255, 0.08);

  /* ---- Tipografi ---- */
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ---- Lain-lain ---- */
  --radius-md: 14px;
  --radius-sm: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --transition-fast: 160ms var(--ease-out);   /* hover/focus/press - harus berasa instan */
  --transition-base: 320ms cubic-bezier(0.22, 1, 0.36, 1); /* entrance screen/modal - boleh lebih santai */
}

/* ---- Font self-hosted (bukan dari Google Fonts CDN) ----
   Alasan: biar bisa di-cache Service Worker buat mode offline (Step 5),
   dan ga gantung ke uptime CDN pihak ketiga. */
@font-face {
  font-family: 'Bebas Neue';
  src: url('../fonts/BebasNeue-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ================= BACKGROUND DECORATIVE ================= */
.gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 800px 500px at 50% -10%, var(--color-red-glow) 0%, transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 64px),
    var(--color-bg);
}

/* ================= LAYOUT ================= */
.gate-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 40px 28px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-red), transparent);
}

/* ================= SCREENS (toggle + transisi) ================= */
.gate-screen {
  display: none;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  animation: screenIn var(--transition-base) both;
}

.gate-screen.is-active {
  display: flex;
}

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

/* ================= BRAND / WELCOME ================= */
.brand {
  margin-bottom: 18px;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--color-red);
  margin-bottom: 4px;
}

.brand-main {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--color-text);
}

.gate-lead {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--color-red);
  margin: 0 0 10px;
}

.gate-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-dim);
  margin: 0 0 28px;
}

/* ================= GAUGE (step indicator) ================= */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}

.gauge {
  width: 120px;
  height: 68px;
  overflow: visible;
}

.gauge-track,
.gauge-fill {
  fill: none;
  stroke-linecap: round;
}

.gauge-track {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.gauge-fill {
  stroke: var(--color-red);
  stroke-width: 6;
  filter: drop-shadow(0 0 6px var(--color-red-glow));
  transition: stroke-dashoffset 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--color-text-dim);
  margin-top: -6px;
}

.screen-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.03em;
  margin: 8px 0 6px;
  color: var(--color-text);
}

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

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.input {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input::placeholder {
  color: #5c5c5c;
}

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

.phone-input-group {
  display: flex;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phone-input-group:focus-within {
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px var(--color-red-glow);
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 600;
  color: var(--color-text-dim);
  border-right: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.02);
}

.phone-input-group .input {
  border: none;
  background: transparent;
  box-shadow: none !important;
}

.phone-readonly {
  background: var(--color-bg-elevated);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--color-text-dim);
}

/* ---- Checkbox custom ---- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-bg-elevated);
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: transform 140ms var(--ease-out), opacity 140ms var(--ease-out);
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box {
  background: var(--color-red);
  border-color: var(--color-red);
}

.checkbox-row input[type="checkbox"]:checked + .checkbox-box::after {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}

.checkbox-row input[type="checkbox"]:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 3px var(--color-red-glow);
}

.checkbox-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-dim);
}

.checkbox-text a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ================= BUTTONS ================= */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  margin-top: 6px;
  background: var(--color-red);
  color: #fff;
  box-shadow: 0 8px 24px var(--color-red-glow);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px var(--color-red-glow);
  }
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  margin-top: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast), transform 120ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn-link:hover {
    color: var(--color-text);
  }
}

.btn-link:active {
  transform: scale(0.96);
}

/* ================= ERROR & DISCLAIMER ================= */
.field-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--color-red);
  margin: 4px 0 2px;
  text-align: left;
}

.field-error:empty {
  display: none;
}

.gate-disclaimer {
  font-size: 11.5px;
  color: var(--color-text-dim);
  line-height: 1.5;
  margin: 16px 0 0;
}

/* ================= LOADING OVERLAY ================= */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(2px);
}

.loading-overlay.is-active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--color-red);
  animation: spin 700ms linear infinite;
}

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

/* ================= RESPONSIVE ================= */
@media (min-width: 480px) {
  .gate-card {
    padding: 48px 40px 36px;
  }

  .brand-main {
    font-size: 60px;
  }
}

@media (max-width: 360px) {
  .gate-card {
    padding: 32px 20px 26px;
  }

  .brand-main {
    font-size: 44px;
  }
}

/* Hormatin preferensi user yang matiin animasi */
@media (prefers-reduced-motion: reduce) {
  .gate-screen,
  .btn,
  .gauge-fill,
  .checkbox-box::after {
    animation: none !important;
    transition: none !important;
  }
}
