/* ============================================================
   wedday — masuk & daftar
   Satu halaman, dua kartu selebar sama yang bergeser saat mode
   berganti. Gaya mengikuti dashboard: krem hangat, kartu putih,
   garis halus, dan aksen rose yang dipakai hemat.
   ============================================================ */

:root {
    --ground: #fdfaf7;
    --surface: #ffffff;
    --raised: #f9f5f1;
    --border: #ebe3db;
    --rule: #f2ece6;
    --control: #d8cec5;
    --text: #2b2421;
    --muted: #74675f;
    --accent: #9a5a62;
    --accent-strong: #834850;
    --accent-ink: #7d434b;
    --brand-ink: #8b6a3e;
    --negative: #a33a35;
    --positive: #4f7a5a;

    --radius-card: 8px;
    --radius-control: 6px;

    /* Lebar tepi dan isi mengikuti landing page supaya kepala dan
       kaki halaman terasa satu keluarga. */
    --edge: clamp(18px, 5vw, 56px);
    --width: 1200px;

    /* Semua kolom dan tombol memakai tinggi yang sama supaya
       baris form terlihat rata dan tidak ada elemen yang menonjol. */
    --control-height: 38px;

    --ff-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ff-display: "Cormorant Garamond", Georgia, serif;

    --ease: cubic-bezier(0.2, 0, 0.2, 1);
    --slide: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    background: var(--ground);
    overflow-x: hidden;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    font-family: var(--ff-ui);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
    background: transparent;
    -ms-overflow-style: none;
    -webkit-font-smoothing: antialiased;
}

/**
 * Warna latar dipasang sebagai lapisan fixed, bukan background body.
 * Background body ikut memanjang setinggi halaman, jadi gradasinya
 * berhenti tepat di batas viewport dan menyisakan garis mendatar.
 * Lapisan fixed selalu menutup penuh di posisi scroll mana pun.
 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(1100px 700px at 86% -20%, rgba(154, 90, 98, 0.07), transparent 68%),
        radial-gradient(900px 620px at 2% 108%, rgba(152, 166, 146, 0.09), transparent 68%);
}

h1,
p {
    margin: 0;
}

button,
input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: rgba(154, 90, 98, 0.18);
}

/* ==================== KEPALA ==================== */

.skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 60;
    padding: 10px 16px;
    background: var(--text);
    color: var(--surface);
    text-decoration: none;
    border-radius: var(--radius-control);
    transform: translateY(-160%);
}

.skip:focus-visible {
    transform: none;
}

.auth-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px var(--edge);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
        backdrop-filter 0.25s var(--ease);
}

.auth-topbar.is-scrolled {
    background: rgba(253, 250, 247, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: rgba(154, 90, 98, 0.1);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.auth-brand-mark {
    display: block;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    object-fit: contain;
}

.auth-brand-name {
    font-family: var(--ff-display);
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-ink);
}

.auth-topnav {
    display: flex;
    gap: clamp(16px, 2.4vw, 34px);
    margin: 0 auto;
    font-size: 14px;
}

.auth-topnav a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.18s var(--ease);
}

.auth-topnav a:hover {
    color: var(--accent-ink);
}

.auth-topbar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
        transform 0.18s var(--ease);
}

.auth-topbar-cta:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.auth-topbar-cta:active {
    transform: translateY(1px);
}

/* ==================== HALAMAN ==================== */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
    min-height: 0;
    padding: clamp(24px, 6vw, 48px) 20px;
}

.auth-shell {
    width: 100%;
    max-width: 400px;
}

/* ==================== KARTU ==================== */

.auth-viewport {
    overflow: hidden;
    border-radius: var(--radius-card);
    box-shadow:
        0 18px 40px -30px rgba(43, 36, 33, 0.36),
        0 1px 2px rgba(43, 36, 33, 0.05);
    opacity: 0;
    transition: height 0.45s var(--slide), opacity 0.2s var(--ease);
}

.auth-viewport.is-ready {
    opacity: 1;
}

/* Halaman verifikasi memakai satu kartu, tanpa track bergeser. */
.auth-single {
    overflow: hidden;
    border-radius: var(--radius-card);
    box-shadow:
        0 18px 40px -30px rgba(43, 36, 33, 0.36),
        0 1px 2px rgba(43, 36, 33, 0.05);
}

.auth-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.45s var(--slide);
}

.auth-viewport[data-mode="register"] .auth-track {
    transform: translateX(-100%);
}

.auth-viewport[data-mode="reset"] .auth-track {
    transform: translateX(-200%);
}

.auth-sheet {
    display: flex;
    flex: 0 0 100%;
    flex-direction: column;
    min-width: 100%;
    padding: 26px 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.auth-sheet[inert] {
    pointer-events: none;
}

/* ==================== BRAND ==================== */

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    object-fit: contain;
}

.wordmark-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wordmark {
    font-family: var(--ff-display);
    font-size: 25px;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-ink);
}

.wordmark-sub {
    font-size: 11px;
    color: var(--muted);
}

.auth-title {
    margin-top: 22px;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.auth-lead {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
    text-wrap: pretty;
}

/* ==================== FORM ==================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.auth-form[hidden] {
    display: none;
}

.float-field {
    position: relative;
}

/* Kode undangan dan kode referral berdampingan supaya baris pertama
   ringkas. Di layar sangat sempit keduanya tetap muat karena labelnya
   pendek; kolom baru ditumpuk kalau lebarnya benar-benar tidak cukup. */
.auth-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.float-control {
    display: flex;
    align-items: center;
    height: var(--control-height);
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--surface);
    cursor: text;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.float-control:hover {
    border-color: var(--control);
}

.float-field:focus-within .float-control {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(154, 90, 98, 0.14);
}

.float-prefix {
    flex: 0 0 auto;
    padding-right: 2px;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    user-select: none;
}

.float-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13.5px;
    outline: none;
}

.float-input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    transition: background-color 9999s ease-out;
}

/* Label mulai sebagai placeholder di dalam kolom, lalu naik ke
   garis atas saat kolom difokuskan atau sudah berisi. */
.float-field > label {
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 1;
    padding: 0 4px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transition:
        top 0.16s var(--ease),
        left 0.16s var(--ease),
        font-size 0.16s var(--ease),
        color 0.16s var(--ease);
}

.float-field.has-prefix > label {
    left: calc(var(--prefix-w, 88px) + 15px);
}

.float-field:focus-within > label,
.float-field.is-filled > label {
    top: 0;
    left: 6px;
    font-size: 10.5px;
    color: var(--accent-ink);
}

.float-field.has-prefix:focus-within > label,
.float-field.has-prefix.is-filled > label {
    left: 6px;
}

.float-optional {
    font-size: 0.9em;
    color: var(--muted);
}

.float-label-nowrap {
    white-space: nowrap;
}

.float-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin: 0 -5px 0 4px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.float-toggle:hover {
    background: var(--raised);
    color: var(--text);
}

.float-inline-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: 16px;
    margin-left: 4px;
    padding: 0 4px;
    border: 0;
    border-radius: 4px;
    background: var(--surface);
    color: var(--accent-ink);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.16s var(--ease), color 0.15s var(--ease);
}

/* Tautan ikut naik ke garis atas kolom saat kolom difokuskan, sejajar
   dengan label mengambang. Angka -19px berasal dari setengah tinggi
   kontrol yang dipakai flex untuk memusatkan tautan. */
.float-field:focus-within .float-inline-link,
.float-field.is-filled .float-inline-link {
    transform: translateY(calc(var(--control-height) / -2));
}

.float-inline-link:hover {
    color: var(--accent-strong);
}

.auth-hint {
    margin: -6px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}

/* Persetujuan sebelum mendaftar. Kotaknya di bawah tombol, jadi
   dicek lagi saat submit dan bukan hanya mengandalkan atribut required. */
.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
}

.auth-consent input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.auth-consent-text a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-consent-text a:hover {
    color: var(--accent-strong);
}

.password-meter {
    display: grid;
    gap: 7px;
    margin-top: -4px;
}

.password-meter[data-level="empty"] {
    display: none;
}

.password-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--muted);
}

.password-meter-head strong {
    font-weight: 500;
    color: var(--muted);
}

.password-meter[data-level="weak"] .password-meter-head strong {
    color: var(--negative);
}

.password-meter[data-level="fair"] .password-meter-head strong {
    color: var(--brand-ink);
}

.password-meter[data-level="good"] .password-meter-head strong {
    color: var(--accent-ink);
}

.password-meter[data-level="strong"] .password-meter-head strong {
    color: var(--positive);
}

.password-meter-track {
    height: 3px;
    border-radius: 0;
    background: var(--rule);
    overflow: hidden;
}

.password-meter-track span {
    display: block;
    width: var(--strength, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--negative);
    transition: width 0.2s var(--ease), background 0.2s var(--ease);
}

.password-meter[data-level="fair"] .password-meter-track span {
    background: var(--brand-ink);
}

.password-meter[data-level="good"] .password-meter-track span {
    background: var(--accent);
}

.password-meter[data-level="strong"] .password-meter-track span {
    background: var(--positive);
}

.password-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--muted);
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.password-rules li::before {
    content: '';
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    border: 1px solid var(--control);
    border-radius: 0;
    background: var(--surface);
    font-size: 8px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.password-rules li.is-met {
    color: var(--text);
}

.password-rules li.is-met::before {
    content: '✓';
    border-color: var(--positive);
    background: var(--positive);
    color: #fff;
}

.password-match {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--muted);
}

.password-match:empty {
    display: none;
}

.password-match.is-match {
    color: var(--positive);
}

.password-match.is-mismatch {
    color: var(--negative);
}

.auth-hint strong {
    font-weight: 500;
    color: var(--accent-ink);
}

.auth-error {
    margin: -4px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--negative);
}

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

.auth-error.is-notice {
    color: var(--muted);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--control-height);
    margin-top: 2px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-control);
    background: var(--accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
        transform 0.15s var(--ease);
}

.auth-submit:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== PINDAH MODE ==================== */

.auth-switchline {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

.auth-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.auth-link:hover {
    color: var(--accent-strong);
}

/* ==================== HALAMAN VERIFIKASI ==================== */

.verify-badge {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 22px auto 0;
    border-radius: 50%;
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 19px;
}

.verify-badge[data-tone="ok"] {
    background: #eef3ea;
    border-color: #dbe6d4;
    color: #5d7355;
}

.verify-badge[data-tone="error"] {
    background: #fbeeed;
    border-color: #f1d9d7;
    color: var(--negative);
}

.verify-badge[data-tone="form"] {
    color: var(--accent-ink);
}

.auth-submit--quiet {
    margin-top: 18px;
    background: var(--surface);
    border-color: var(--border);
    color: var(--accent-ink);
    text-decoration: none;
}

.auth-submit--quiet:hover {
    background: var(--raised);
    border-color: var(--control);
    color: var(--accent-strong);
}

.auth-submit[hidden] {
    display: none;
}

/* ==================== HALAMAN DOKUMEN ==================== */

.auth-shell--doc {
    max-width: 680px;
}

.doc {
    padding: 32px 36px 30px;
}

.doc .auth-title {
    margin-top: 20px;
}

.doc-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.doc h2 {
    margin-top: 26px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.doc p,
.doc ul {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--muted);
}

.doc ul {
    padding-left: 18px;
}

.doc li + li {
    margin-top: 6px;
}

.doc strong {
    font-weight: 600;
    color: var(--text);
}

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

.doc a:hover {
    color: var(--accent-strong);
}

.doc-back {
    margin-top: 28px;
}

/* Tombol kembali memakai gaya tombol, bukan tautan biasa. */
.doc a.doc-back,
.doc a.doc-back:hover {
    text-decoration: none;
}

/* ==================== KAKI ==================== */

.auth-footer {
    padding: clamp(40px, 6vw, 64px) var(--edge) 24px;
    background: linear-gradient(180deg, #fbf0f1 0%, #f8e8ea 100%);
    border-top: 1px solid rgba(154, 90, 98, 0.08);
}

.auth-footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    max-width: var(--width);
    margin: 0 auto;
}

.auth-footer-brand p {
    margin-top: 12px;
    max-width: 54ch;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.auth-footer-social {
    display: flex;
    align-self: start;
    gap: 8px;
}

.auth-footer-social a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent);
    font-size: 17px;
    text-decoration: none;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.auth-footer-social a:hover {
    background: var(--accent);
    color: #fff;
}

.auth-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    max-width: var(--width);
    margin: 32px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(154, 90, 98, 0.12);
    font-size: 12px;
    color: var(--muted);
}

.auth-footer-imprint,
.auth-footer-legal {
    margin: 0;
    font-size: 12px;
}

.auth-footer-legal {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-footer-imprint a,
.auth-footer-legal a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s var(--ease);
}

.auth-footer-imprint a:hover,
.auth-footer-legal a:hover {
    color: var(--accent-ink);
    text-decoration: underline;
}

.auth-foot {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
}

.auth-foot a {
    color: inherit;
    text-decoration: none;
}

.auth-foot a:hover {
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==================== LAYAR KECIL ==================== */

@media (max-width: 760px) {
    .auth-topnav {
        display: none;
    }

    .auth-topbar {
        justify-content: space-between;
    }

    .auth-footer-inner {
        grid-template-columns: 1fr;
    }

    .auth-footer-social {
        order: 3;
    }

    .auth-footer-bottom {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 20px 16px 24px;
    }

    .auth-topbar {
        padding: 10px 16px;
    }

    .auth-brand-mark {
        width: 32px;
        height: 32px;
    }

    .auth-brand-name {
        font-size: 22px;
    }

    .auth-topbar-cta {
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .auth-footer {
        padding: 40px 16px 22px;
    }

    .auth-sheet {
        padding: 22px 20px 20px;
    }

    .doc {
        padding: 24px 20px 22px;
    }

    .auth-title {
        margin-top: 20px;
        font-size: 19.5px;
    }

    .wordmark {
        font-size: 23px;
    }
}

@media (max-width: 340px) {
    .auth-sheet {
        padding: 20px 16px 18px;
    }

    .auth-pair {
        grid-template-columns: 1fr;
    }

    .float-prefix {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-track,
    .auth-viewport,
    .float-field > label,
    .float-inline-link,
    .auth-submit,
    .password-meter-track span,
    .password-rules li::before {
        transition: none;
    }
}
