/* ZIC Coming Soon — handcrafted (no template UI)
   Notes:
   - Dark/Light via html[data-theme]
   - Language flag highlight via html[data-lang]
   - Uses Inter via Google Fonts CDN
*/

:root{
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 14px;

  --shadow: 0 24px 70px rgba(0,0,0,.45);

  /* dark defaults */
  --bg: #09090b;
  --surface: #18181b;
  --text: #ffffff;
  --muted: #a1a1aa;
  --muted2: rgba(255,255,255,.60);
  --border: rgba(255,255,255,.10);
  --border2: rgba(255,255,255,.16);
  --grid: rgba(255,255,255,.02);
  --accent: #ffffff;
  --green: #22c55e;

  --input-bg: rgba(24,24,27,.50);
  --input-ring: rgba(255,255,255,.25);
}

html[data-theme="light"]{
  --bg: #f7f7fb;
  --surface: rgba(255,255,255,.85);
  --text: #0f172a;
  --muted: rgba(15,23,42,.70);
  --muted2: rgba(15,23,42,.55);
  --border: rgba(15,23,42,.10);
  --border2: rgba(15,23,42,.16);
  --grid: rgba(15,23,42,.04);
  --shadow: 0 24px 70px rgba(15,23,42,.18);

  --input-bg: rgba(255,255,255,.75);
  --input-ring: rgba(15,23,42,.20);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

::selection{
  background: var(--text);
  color: var(--bg);
}

.bg-grid{
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  z-index: 0;
}

.bg-vignette{
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 480px at 20% 30%, rgba(255,255,255,.05), transparent 55%),
    radial-gradient(1100px 600px at 80% 40%, rgba(255,255,255,.04), transparent 60%),
    linear-gradient(to top, rgba(0,0,0,.25), transparent 55%);
  z-index: 1;
}

.topbar{
  position: fixed;
  inset: 0 0 auto 0;
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 5;
}

.brand{ display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.logo{
  height: 68px;
  width: auto;
  max-width: min(380px, 70vw);
  display: block;
  filter: drop-shadow(0 0 15px rgba(255,255,255,0.10));
}

/* Themed logos */
.logo-light{ display: inline-block; }
.logo-dark{ display: none; }
html[data-theme="dark"] .logo-light{ display: none; }
html[data-theme="dark"] .logo-dark{ display: inline-block; }

.controls{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Typography smoothing */
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Language dropdown */
.lang-select{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.lang-toggle:hover{ transform: translateY(-1px); border-color: var(--border2); }
.lang-toggle:active{ transform: translateY(0); }

.lang-icon{
  width: 18px;
  height: 18px;
  color: var(--text);
}
.lang-icon svg{ width: 18px; height: 18px; display: block; }

.lang-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transform-origin: top right;
  z-index: 20;
}

.lang-item{
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.lang-item:hover{
  background: color-mix(in srgb, var(--border2) 35%, transparent);
  transform: translateY(-1px);
}
.lang-item:active{ transform: translateY(0); }

.mini-flag svg{
  width: 22px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 10px 20px rgba(0,0,0,.14);
}

.lang-text{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.1;
}

html[data-lang="vi"] .lang-item[data-lang="vi"],
html[data-lang="en"] .lang-item[data-lang="en"]{
  background: color-mix(in srgb, var(--text) 14%, transparent);
}

@media (prefers-reduced-motion: no-preference){
  .lang-menu{
    animation: menuIn 160ms var(--ease) both;
  }
}
@keyframes menuIn{
  from{ opacity: 0; transform: translateY(-6px) scale(.98); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

/* Theme button */
.theme-btn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.theme-btn:hover{ transform: translateY(-1px); border-color: var(--border2); }
.theme-btn:active{ transform: translateY(0); }
.theme-icon{ width: 18px; height: 18px; position: relative; color: var(--text); }
.theme-icon svg{ position: absolute; inset: 0; width: 18px; height: 18px; }
html[data-theme="dark"] .icon-sun{ opacity: .95; }
html[data-theme="dark"] .icon-moon{ opacity: 0; }
html[data-theme="light"] .icon-sun{ opacity: 0; }
html[data-theme="light"] .icon-moon{ opacity: .95; }

/* Layout */
.wrap{
  position: relative;
  z-index: 3;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 84px 18px 28px;
}

.panel{
  width: min(680px, 92vw);
  text-align: center;
  padding: 10px 10px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
}


.title{
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, rgba(255,255,255,.92) 35%, rgba(255,255,255,.55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .title{
  background: linear-gradient(135deg, rgba(15,23,42,1) 0%, rgba(15,23,42,.92) 40%, rgba(15,23,42,.55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle{
  margin: 0 auto 22px;
  max-width: 56ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}

/* Progress */
.progress-shell{ display: flex; justify-content: center; }
.progress-track{
  width: min(460px, 100%);
  height: 44px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border2);
  padding: 6px;
  position: relative;
  overflow: hidden;
}

.progress-fill{
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  position: relative;
  overflow: hidden;
  transition: width 2200ms cubic-bezier(0.22, 1, 0.36, 1);
}


html[data-theme="light"] .progress-fill{
  background: #0f172a;
}
html[data-theme="light"] .progress-text{
  mix-blend-mode: normal;
  color: #ffffff;
}

.progress-shimmer{
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(0,0,0,.10), transparent);
  transform: translateX(-100%);
  opacity: .55;
  animation: shimmer 2.5s linear infinite;
}
html[data-theme="light"] .progress-shimmer{
  background: linear-gradient(to right, transparent, rgba(255,255,255,.55), transparent);
}

.progress-center{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.progress-text{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #ffffff;
}

/* Status line */
.statusline{
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ping{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
  position: relative;
}
.ping::before{
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 1px solid rgba(34,197,94,.40);
  opacity: .65;
  animation: pulse 1.6s var(--ease) infinite;
}
.status-text{
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted2);
}

/* Form */
.form{ margin-top: 22px; }
.field{
  position: relative;
  width: min(460px, 100%);
  margin: 0 auto;
}
#email-input{
  width: 100%;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 16px 54px 16px 18px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
#email-input::placeholder{ color: color-mix(in srgb, var(--muted) 75%, transparent); }
#email-input:hover{ border-color: color-mix(in srgb, var(--border2) 85%, transparent); }
#email-input:focus{
  border-color: var(--input-ring);
  transform: translateY(-1px);
}

.submit{
  position: absolute;
  right: 10px;
  top: 10px;
  bottom: 10px;
  width: 44px;
  border-radius: 12px;
  border: 0;
  background: var(--accent);
  color: #0b0b0e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.submit:hover{ transform: scale(1.05); filter: brightness(.96); }
.submit:active{ transform: scale(1.02); }
.submit svg{ width: 18px; height: 18px; }

.form-error{
  margin: 10px auto 0;
  width: min(460px, 100%);
  min-height: 1.1em;
  font-size: 12px;
  font-weight: 700;
  color: #f43f5e;
}

.form-note{
  margin: 10px auto 0;
  width: min(460px, 100%);
  font-size: 11px;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

/* Footer */
.footer{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.copyright{
  margin: 0;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
}

/* Animation */
.animate-item{ opacity: 0; transform: translateY(18px); }
.animate-in{
  animation: fadeInUp 900ms var(--ease) forwards;
}
@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(18px); }
  to{ opacity: 1; transform: translateY(0); }
}
@keyframes shimmer{
  0%{ transform: translateX(-100%); }
  100%{ transform: translateX(100%); }
}
@keyframes pulse{
  0%{ transform: scale(.72); opacity: .85; }
  70%{ transform: scale(1.15); opacity: 0; }
  100%{ transform: scale(1.15); opacity: 0; }
}

/* Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px color-mix(in srgb, var(--input-bg) 92%, transparent) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Focus styles */
:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--text) 25%, transparent);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 520px){
  .topbar{ padding: 18px 16px; }
  .logo{ height: 56px; }
  .panel{ padding: 28px 18px 20px; }
  .progress-track{ height: 42px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .progress-shimmer{ animation: none; }
  .ping::before{ animation: none; opacity: .25; }
  .animate-in{ animation: none; opacity: 1; transform: none; }
  .animate-item{ opacity: 1; transform: none; }
  body{ overflow: auto; }
}

/* Screen-reader */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


html[data-theme="light"] .progress-track{
  background: rgba(255,255,255,.75);
}
