/* REKAVAN — Login & Register premium (hijau khas REKAVAN).
   Dimuat hanya oleh login.html & register.html; di-scope ke body.page-auth. Tanpa logika. */
/* Transisi halaman: fade-in halus saat halaman dimuat */
body.page-auth { animation: aPageIn 0.35s ease both; }
@keyframes aPageIn { from { opacity: 0; } }

body.page-auth { --line: #e1eae6; background: #f3f8f5; color: var(--ink); }
.page-auth :focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 2px; }

/* ---------- Boot (layar pemuatan awal) ---------- */
.page-auth .boot { background: #f3f8f5; color: var(--mut); gap: 16px; }
.page-auth .boot img { width: 60px; height: 60px; animation: bootPulse 1.6s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(18, 140, 126, 0.35)); }
.page-auth .boot p { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; opacity: 1; }
.page-auth .boot::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(37, 211, 102, 0.2); border-top-color: var(--g-2); animation: aSpin 0.8s linear infinite; }
@keyframes bootPulse { 50% { transform: scale(1.07); } }

/* ---------- Layout ---------- */
.page-auth .auth { min-height: 100vh; min-height: 100dvh; background: transparent; }
.page-auth .auth-main { position: relative; overflow: hidden; display: grid; place-items: start center; padding: 112px 16px calc(32px + env(safe-area-inset-bottom)); isolation: isolate; }
/* Pita hijau di atas (mobile) agar card tampak mengambang di atasnya */
.page-auth .auth-main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 232px; z-index: -1; background: radial-gradient(90% 140% at 100% 0%, #16a06a 0%, var(--deep) 50%, var(--night) 100%); border-radius: 0 0 40px 40px; }
.page-auth .auth-main::after { content: ""; position: absolute; inset: 0; z-index: -2; background-image: radial-gradient(rgba(7, 94, 84, 0.07) 1px, transparent 1px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(180deg, transparent 20%, #000 100%); mask-image: linear-gradient(180deg, transparent 20%, #000 100%); }
.a-blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: 0.5; pointer-events: none; }
.a-blob.b1 { width: 260px; height: 260px; right: -90px; bottom: 6%; background: #b9f0cf; }
.a-blob.b2 { width: 220px; height: 220px; left: -90px; bottom: 28%; background: #d8f6e5; }

/* ---------- Floating card ---------- */
.page-auth .auth-card { position: relative; width: min(440px, 100%); background: #fff; border: 1px solid rgba(7, 94, 84, 0.08); border-radius: 28px; padding: 28px 22px 24px; box-shadow: 0 1px 2px rgba(7, 50, 43, 0.06), 0 28px 60px -24px rgba(7, 50, 43, 0.38), 0 8px 20px -12px rgba(7, 50, 43, 0.18); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s; animation: aCardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.page-auth .auth-card.register { width: min(460px, 100%); }
@media (hover: hover) { .page-auth .auth-card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(7, 50, 43, 0.06), 0 36px 70px -24px rgba(7, 50, 43, 0.42), 0 10px 24px -12px rgba(7, 50, 43, 0.2); } }
@keyframes aCardIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
/* Brand ditempatkan di atas card (pada pita hijau) untuk mobile */
.page-auth .auth-card .brand-inline { position: absolute; left: 0; right: 0; top: -64px; justify-content: center; margin: 0; color: #fff; }
.page-auth .auth-card .brand-inline b { font-family: var(--font); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.page-auth .auth-card h1 { font-family: var(--font); font-size: 25px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 8px; }
.page-auth .auth-card .lead { color: var(--mut); font-size: 14.5px; line-height: 1.55; margin-bottom: 22px; }

/* ---------- Field ---------- */
.page-auth .field { margin-bottom: 16px; animation: aRise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.page-auth form .field:nth-of-type(1) { animation-delay: 0.08s; }
.page-auth form .field:nth-of-type(2) { animation-delay: 0.14s; }
.page-auth form .field:nth-of-type(3) { animation-delay: 0.2s; }
.page-auth form .field:nth-of-type(4) { animation-delay: 0.26s; }
@keyframes aRise { from { opacity: 0; transform: translateY(10px); } }
.a-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.a-lbl label { margin: 0; font-size: 13px; font-weight: 800; color: #33463f; }
.a-forgot { font-size: 12.5px; font-weight: 800; color: var(--teal); padding: 4px 0; transition: color 0.2s; }
.a-forgot:hover { color: var(--deep); text-decoration: underline; text-underline-offset: 3px; }
.a-inp { position: relative; display: flex; align-items: center; }
.a-inp .input { min-height: 52px; padding: 12px 14px 12px 46px; border-radius: 15px; background: #f8fbfa; border: 1.5px solid var(--line); font-size: 16px; font-weight: 600; transition: border-color 0.2s, box-shadow 0.25s, background 0.2s; }
.a-inp.has-eye .input { padding-right: 52px; }
.a-inp .input:hover { border-color: #cbdcd4; }
.a-inp .input:focus { background: #fff; border-color: var(--g-2); box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.16); outline: none; }
.a-inp .input::placeholder { color: #9db3ab; font-weight: 500; }
.a-ic { position: absolute; left: 15px; display: grid; place-items: center; color: #8aa59b; pointer-events: none; transition: color 0.2s; }
.a-inp:focus-within .a-ic { color: var(--teal); }
.a-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #7a948a; display: grid; place-items: center; cursor: pointer; transition: background 0.2s, color 0.2s; -webkit-tap-highlight-color: transparent; }
.a-eye:hover { background: #eaf4ef; color: var(--deep); }
.a-eye .eye-off { display: none; }
.a-eye[aria-pressed="true"] .eye-on { display: none; }
.a-eye[aria-pressed="true"] .eye-off { display: block; }
.a-eye[aria-pressed="true"] { color: var(--teal); }
/* State error pada input */
.a-inp.invalid .input { border-color: #e5484d; background: #fffafa; box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.1); }
.a-inp.invalid .a-ic { color: #e5484d; }

/* ---------- Pesan error ---------- */
.page-auth .form-err { margin: 0 0 14px; min-height: 0; }
.page-auth .form-err:empty { display: none; }
.page-auth .form-err:not(:empty) { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 14px; background: #fff3f3; border: 1px solid #f7cfd1; color: #b42329; font-size: 13.5px; font-weight: 700; line-height: 1.45; animation: errIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.page-auth .form-err:not(:empty)::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
@keyframes errIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Tombol floating ---------- */
.page-auth .a-submit { position: relative; min-height: 54px; margin-top: 4px; border-radius: 17px; font-size: 16px; font-weight: 800; letter-spacing: 0.005em; color: #05361f; background: linear-gradient(135deg, var(--g) 0%, var(--g-2) 100%); border: 0; overflow: hidden; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 14px 26px -10px rgba(30, 190, 90, 0.85), 0 4px 8px -4px rgba(30, 190, 90, 0.5); transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, filter 0.2s; }
.page-auth .a-submit::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent); pointer-events: none; }
.page-auth .a-submit .a-btn-arrow { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (hover: hover) {
  .page-auth .a-submit:hover:not([disabled]) { transform: translateY(-2px); filter: saturate(1.08); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 20px 32px -12px rgba(30, 190, 90, 0.95), 0 6px 12px -6px rgba(30, 190, 90, 0.5); }
  .page-auth .a-submit:hover:not([disabled]) .a-btn-arrow { transform: translateX(3px); }
}
.page-auth .a-submit:active:not([disabled]) { transform: translateY(0) scale(0.985); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 8px 16px -8px rgba(30, 190, 90, 0.8); }
/* Loading di tombol */
.a-spin { display: none; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(5, 54, 31, 0.22); border-top-color: #05361f; animation: aSpin 0.75s linear infinite; will-change: transform; }
@keyframes aSpin { to { transform: rotate(360deg); } }
.page-auth .a-submit.is-loading { cursor: progress; }
.page-auth .a-submit.is-loading[disabled] { opacity: 1; transform: none; filter: none; }
.page-auth .a-submit.is-loading .a-spin { display: block; }
.page-auth .a-submit.is-loading .a-btn-arrow { display: none; }

/* ---------- Link bawah ---------- */
.page-auth .auth-alt { margin-top: 20px; text-align: center; font-size: 14px; color: var(--mut); }
.page-auth .auth-alt a { color: var(--teal); font-weight: 800; padding: 6px 2px; transition: color 0.2s; }
.page-auth .auth-alt a:hover { color: var(--deep); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Overlay loading (modal putih mengambang) ---------- */
.page-auth .loader { display: grid; opacity: 0; visibility: hidden; background: rgba(8, 40, 34, 0.38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity 0.25s ease, visibility 0s linear 0.25s; }
.page-auth .loader.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.page-auth .loader-box { width: min(320px, calc(100vw - 40px)); padding: 30px 26px 26px; border-radius: 24px; gap: 6px; text-align: center; font-weight: 800; font-size: 16px; color: var(--ink); border: 1px solid rgba(7, 94, 84, 0.08); box-shadow: 0 30px 70px -20px rgba(7, 50, 43, 0.55); transform: translateY(10px) scale(0.97); opacity: 0; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s; }
.page-auth .loader.on .loader-box { transform: none; opacity: 1; }
.page-auth .loader-box .spin { width: 44px; height: 44px; border-width: 4px; border-color: rgba(37, 211, 102, 0.18); border-top-color: var(--g-2); margin-bottom: 10px; animation: aSpin 0.8s linear infinite; will-change: transform; }
.page-auth .loader-box::after { content: "Mohon tunggu sebentar."; font-size: 13px; font-weight: 600; color: var(--mut); }
/* Saat proses berasal dari tombol Login/Daftar: loading tampil di tombol saja (tidak ada dua loading). */
.page-auth.a-busy .loader { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.page-auth.a-busy .loader-box { opacity: 0 !important; transform: none; }

/* ---------- Notifikasi (toast) ---------- */
.page-auth #toasts { top: calc(14px + env(safe-area-inset-top)); justify-items: center; }
.page-auth .toast { gap: 12px; padding: 12px 16px 12px 12px; border-radius: 16px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--teal); font-weight: 700; box-shadow: 0 20px 40px -18px rgba(7, 50, 43, 0.45), 0 4px 10px -6px rgba(7, 50, 43, 0.2); transform: translateY(-14px) scale(0.98); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s; }
.page-auth .toast.in { transform: none; }
.page-auth .toast-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; }
.page-auth .toast.ok { border-left-color: var(--g-2); }
.page-auth .toast.ok .toast-ic { background: #e3f8ec; color: #0a8a47; }
.page-auth .toast.bad { border-left-color: #e5484d; }
.page-auth .toast.bad .toast-ic { background: #fde8e9; color: #d0343b; }
.page-auth .toast.warn { border-left-color: #f5a524; }
.page-auth .toast.warn .toast-ic { background: #fff3d6; color: #b7791f; }
.page-auth .toast.info .toast-ic { background: #e8f0fe; color: #3b6fd8; }

/* Modal "Reset password" mengikuti gaya yang sama */
.page-auth .modal-ov { background: rgba(8, 40, 34, 0.38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.page-auth .modal { border-radius: 24px; border: 1px solid rgba(7, 94, 84, 0.08); box-shadow: 0 30px 70px -20px rgba(7, 50, 43, 0.55); }
.page-auth .modal h3 { font-family: var(--font); font-weight: 800; font-size: 19px; }
.page-auth .modal .input { min-height: 50px; border-radius: 14px; font-size: 16px; }
.page-auth .modal .btn { min-height: 48px; border-radius: 14px; font-weight: 800; }
.page-auth .modal .btn-primary { box-shadow: 0 12px 22px -10px rgba(30, 190, 90, 0.8); }

/* ---------- Panel ilustrasi kiri (desktop) ---------- */
.a-art-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.a-art-brand b { font-family: var(--font); font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.a-art-copy { position: relative; z-index: 1; }
.a-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.a-orb.o1 { width: 360px; height: 360px; right: -140px; top: 10%; border: 44px solid rgba(255, 255, 255, 0.05); }
.a-orb.o2 { width: 220px; height: 220px; left: -80px; bottom: 18%; background: radial-gradient(circle, rgba(91, 224, 143, 0.22), transparent 70%); }
@media (min-width: 900px) {
  .page-auth .auth { grid-template-columns: 1.05fr 1fr; padding: 16px; gap: 0; }
  .page-auth .auth-art { border-radius: 32px; padding: 44px; min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); background: radial-gradient(90% 90% at 0% 0%, #14876a 0%, var(--deep) 45%, var(--night) 100%); box-shadow: 0 30px 60px -34px rgba(7, 50, 43, 0.7); animation: aCardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
  .page-auth .auth-art h2 { font-family: var(--font); font-size: clamp(32px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
  .page-auth .auth-art p { font-size: 16px; line-height: 1.65; }
  .page-auth .auth-art .bubbles { position: relative; z-index: 1; max-width: 340px; }
  .page-auth .bub { padding: 12px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.5); animation: aFloat 6s ease-in-out infinite; }
  .page-auth .bub.me { background: rgba(217, 253, 211, 0.95); border-color: transparent; animation-delay: -3s; }
  .page-auth .auth-main { place-items: center; padding: 32px; }
  .page-auth .auth-main::before { display: none; }
  .page-auth .auth-main::after { -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
  .page-auth .auth-card { padding: 36px 34px 30px; }
  .page-auth .auth-card .brand-inline { display: none; }
  .page-auth .auth-card h1 { font-size: 28px; }
  .a-blob.b1 { width: 340px; height: 340px; right: -100px; top: 6%; bottom: auto; }
  .a-blob.b2 { width: 280px; height: 280px; left: -60px; bottom: 4%; }
}
@keyframes aFloat { 50% { transform: translateY(-6px); } }

@media (max-width: 380px) {
  .page-auth .auth-main { padding-inline: 12px; }
  .page-auth .auth-card { padding: 24px 18px 20px; border-radius: 24px; }
  .page-auth .auth-card h1 { font-size: 23px; }
}
@media (max-height: 640px) and (max-width: 899px) { .page-auth .auth-main { padding-top: 96px; } .page-auth .auth-main::before { height: 208px; } .page-auth .auth-card .brand-inline { top: -56px; } }
@media (prefers-reduced-motion: reduce) {
  .page-auth .auth-card, .page-auth .field, .page-auth .auth-art, .page-auth .bub, .page-auth .form-err { animation: none !important; }
  .page-auth .a-submit, .page-auth .auth-card { transition: none !important; }
  body.page-auth { animation: none !important; }
}
