/* PilahNexa AI - gaya bersama halaman login & register
   Simpan di: static/auth.css */

:root {
  color-scheme: light;
  --green: #269b52;
  --green-mid: #287b48;
  --green-deep: #175d38;
  --ink: #203d2b;
  --ink-2: #365442;
  --muted: #6b7c72;
  --line: #dce8df;
  --surface: #fbfefc;
  --focus: rgba(32, 168, 91, 0.14);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
button, input { font: inherit; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(ellipse at 8% 12%, rgba(50, 205, 110, 0.16), transparent 32%),
    radial-gradient(ellipse at 92% 88%, rgba(13, 143, 70, 0.12), transparent 30%),
    linear-gradient(135deg, #f7fff9, #edf8f0 55%, #f8fffa);
}

/* ---------- Kartu ---------- */
.auth-card {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  overflow: hidden;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(14, 75, 40, 0.14), 0 6px 20px rgba(20, 76, 43, 0.05);
}

/* ---------- Panel brand ---------- */
.brand {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  padding: 48px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #388e58, #287c49 50%, #175d38);
}

.brand::before, .brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}
.brand::before {
  width: 380px; height: 380px; top: -170px; right: -150px;
  box-shadow: 0 0 0 35px rgba(255, 255, 255, 0.035), 0 0 0 75px rgba(255, 255, 255, 0.025);
}
.brand::after {
  width: 290px; height: 290px; bottom: -170px; left: -100px;
  box-shadow: 0 0 0 35px rgba(255, 255, 255, 0.035);
}

.logo {
  position: relative;
  isolation: isolate;
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 10px;
  margin-bottom: 26px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.3), 0 0 50px rgba(76, 255, 150, 0.25);
}
.logo::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(139, 255, 184, 0.28) 40%, transparent 72%);
  filter: blur(12px);
  animation: glow 3s ease-in-out infinite alternate;
}
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; }

@keyframes glow {
  from { opacity: 0.65; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.05); }
}

.brand h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.15;
}
.brand h1 span { color: #b9ffd2; }

.brand-desc {
  max-width: 400px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.75;
}

.features { display: grid; gap: 12px; list-style: none; }
.features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}
.features .ico {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

/* ---------- Panel form ---------- */
.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 52px 32px;
}

.mobile-brand { display: none; }

.panel-head { margin-bottom: 24px; }
.panel-head h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.9px;
  line-height: 1.25;
}
.panel-head p { color: var(--muted); font-size: 14px; line-height: 1.7; }

.alert {
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.alert-error { color: #b52e35; background: #fff1f1; border: 1px solid #ffd6d6; }
.alert-success { color: #16783e; background: #edfff3; border: 1px solid #c9efd6; }

/* ---------- Field ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  top: 50%; left: 16px;
  display: flex;
  color: #8ba394;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-icon svg, .toggle svg, .btn svg.line {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.control {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 48px;
  color: #183d29;
  font-size: 16px; /* 16px mencegah zoom otomatis di iOS */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.control::placeholder { color: #a2afa6; opacity: 1; }
.control:hover { border-color: #b9d9c3; }
.control:focus { background: #fff; border-color: #20a85b; box-shadow: 0 0 0 4px var(--focus); }

.toggle {
  position: absolute;
  top: 50%; right: 7px;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  color: #7d9284;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transform: translateY(-50%);
}
.toggle:hover { color: var(--green); background: #edfff3; }

.options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 20px;
}
.check { display: inline-flex; align-items: center; gap: 8px; color: #5f7068; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.link { color: #128a48; font-size: 13px; font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Tombol ---------- */
.btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

.btn-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(120deg, #42a963, #287a48);
  box-shadow: 0 10px 24px rgba(16, 148, 76, 0.2);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16, 148, 76, 0.27); }

.btn-google {
  color: #3c4043;
  background: #fff;
  border: 1px solid #d5dbd7;
}
.btn-google:hover { background: #f7faf8; border-color: #b9c4bd; box-shadow: 0 2px 8px rgba(20, 60, 36, 0.08); }
.btn-google svg { flex: 0 0 20px; width: 20px; height: 20px; }

.btn-soft {
  min-height: 46px;
  color: #168344;
  font-size: 13px;
  background: #f4fcf6;
  border: 1px solid #cfe9d7;
}
.btn-soft:hover { background: #e9f9ee; border-color: #a9daba; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #8a988f;
  font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #e6eee8; }

.alt-actions { display: grid; gap: 10px; }
.hint { margin-top: 8px; color: #8a988f; font-size: 12px; line-height: 1.6; text-align: center; }

.switch { margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.switch a { color: #118b4a; font-weight: 800; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

.foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #edf2ee;
  color: #8a988f;
  font-size: 11px;
  text-align: center;
}

a:focus-visible, button:focus-visible { outline: 3px solid rgba(25, 164, 83, 0.4); outline-offset: 3px; }

/* ---------- Responsif ---------- */
@media (max-height: 800px) and (min-width: 821px) {
  body { align-items: start; }
  .auth-card { margin-block: auto; }
  .brand, .panel { padding-block: 30px; }
  .logo { width: 130px; margin-bottom: 18px; }
  .field { margin-bottom: 13px; }
}

@media (max-width: 820px) {
  body { align-items: start; padding: 14px; }
  .auth-card { display: block; max-width: 480px; margin: auto; border-radius: 24px; }
  .brand { display: none; }
  .panel { padding: 26px 22px 22px; }

  .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
  .mobile-brand .logo {
    flex: 0 0 64px; width: 64px; padding: 4px; margin: 0;
    border: 1px solid var(--line);
    box-shadow: 0 0 14px rgba(43, 156, 81, 0.14);
  }
  .mobile-brand .logo::before { inset: -8px; }
  .mobile-brand strong { display: block; color: var(--green-mid); font-size: 21px; font-weight: 800; letter-spacing: -0.5px; }
  .mobile-brand small { color: var(--muted); font-size: 12px; }
}

@media (max-width: 380px) {
  body { padding: 8px; }
  .panel { padding: 22px 16px 18px; }
  .control { padding-inline: 42px; }
  .input-icon { left: 13px; }
}

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