/* ============================================================
   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: #f6f1eb;
    --surface: #ffffff;
    --raised: #f9f5f1;
    --border: #ebe3db;
    --rule: #f2ece6;
    --control: #d8cec5;
    --text: #2b2421;
    --muted: #74675f;
    --accent: #9a5a62;
    --accent-strong: #834850;
    --accent-ink: #7d434b;
    --negative: #a33a35;

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

    /* 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);
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--ff-ui);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
    background: transparent;
    -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);
}

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

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    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-sprig {
    width: 22px;
    height: 29px;
    flex: 0 0 auto;
}

.brand-stem {
    fill: none;
    stroke: #98a692;
    stroke-width: 1.1;
    stroke-linecap: round;
}

.brand-leaves path {
    fill: #e4eadf;
    stroke: #8c9b86;
    stroke-width: 0.8;
}

.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(--text);
}

.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;
}

.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-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);
}

.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);
}

.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-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 8px;
}

.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-top: 22px;
    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-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: 480px) {
    .auth-page {
        padding: 20px 16px 24px;
    }

    .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;
    }

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

@media (prefers-reduced-motion: reduce) {
    .auth-track,
    .auth-viewport,
    .float-field > label,
    .auth-submit {
        transition: none;
    }
}
