/* =========================================================
   BUKU TAMU - PT BETON LEIBEL PERSADA
   Responsive stylesheet
   File: assets/frontend/css/buku-tamu.css

   Cocok untuk:
   - HP kecil (320px+)
   - HP besar
   - Tablet
   - Laptop dan desktop
   ========================================================= */

:root {
    --guest-primary: #0863c9;
    --guest-primary-dark: #0756b8;
    --guest-navy: #103f78;
    --guest-navy-deep: #0a3268;
    --guest-text: #172b49;
    --guest-muted: #61748f;
    --guest-border: #d7e1ef;
    --guest-page: #f3f7fc;
    --guest-white: #ffffff;
    --guest-danger: #d92d36;
    --guest-success: #078c5e;
    --guest-radius: 16px;
    --guest-shadow: 0 12px 34px rgba(20, 54, 92, 0.08);
}

/* ------------------------------
   Base & accessibility
   ------------------------------ */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--guest-text);
    background:
        radial-gradient(circle at 95% 25%, rgba(220, 234, 250, 0.42), transparent 30%),
        var(--guest-page);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(8, 99, 201, 0.28);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.guest-container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

/* ------------------------------
   Hero / background
   ------------------------------ */

.guest-hero {
    position: relative;
    isolation: isolate;
    min-height: 350px;
    overflow: hidden;
    color: var(--guest-white);
    background-color: #174d84;
    background-image:
        linear-gradient(
            90deg,
            rgba(5, 43, 85, 0.96) 0%,
            rgba(8, 56, 105, 0.86) 34%,
            rgba(10, 61, 112, 0.53) 62%,
            rgba(10, 61, 112, 0.20) 100%
        ),
        url("../imgs/buku-tamu-hero.jpg");
    background-position: center, center 48%;
    background-repeat: no-repeat;
    background-size: cover;
}

.guest-hero__overlay {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(
        0deg,
        rgba(8, 43, 84, 0.20) 0%,
        rgba(8, 43, 84, 0) 58%
    );
    pointer-events: none;
}

.guest-hero__content {
    position: relative;
    z-index: 1;
    padding-top: 24px;
    padding-bottom: 78px;
}

/* Logo memakai logo.png dengan warna aslinya.
   Bidang putih memberi kontras di atas foto hero. */

.guest-hero .guest-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 8px 11px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(5, 30, 60, 0.14);
    text-decoration: none;
    vertical-align: top;
}

.guest-hero .guest-brand__logo {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
    max-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
    object-position: center;
}

.guest-hero__text {
    width: 100%;
    max-width: 540px;
    margin-top: 22px;
}

.guest-hero__text h1 {
    max-width: 540px;
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 3.5vw, 44px);
    font-weight: 750;
    line-height: 1.12;
    letter-spacing: -0.8px;
    text-wrap: balance;
}

.guest-hero__text p {
    max-width: 440px;
    margin: 13px 0 0;
    color: rgba(255, 255, 255, 0.97);
    font-size: 16px;
    line-height: 1.6;
    text-wrap: pretty;
}

/* ------------------------------
   Main card
   ------------------------------ */

.guest-main {
    position: relative;
    z-index: 2;
    width: min(1080px, calc(100% - 40px));
    margin: -40px auto 30px;
}

.guest-form {
    padding: 28px;
    border: 1px solid rgba(221, 231, 243, 0.96);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: var(--guest-shadow);
}

/* ------------------------------
   Form sections
   ------------------------------ */

.guest-section {
    padding: 0 0 27px;
    margin: 0 0 27px;
    border-bottom: 1px solid #e5ecf5;
}

.guest-section:last-of-type {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.guest-section__heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.guest-section__icon {
    display: flex;
    flex: 0 0 54px;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
}

.guest-section__icon svg {
    display: block;
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.guest-section__icon--blue {
    color: #0863c9;
    background: #e4f0ff;
}

.guest-section__icon--red {
    color: #d92d36;
    background: #ffeaec;
}

.guest-section__icon--green {
    color: #078c5e;
    background: #e0f7ed;
}

.guest-section__heading h2 {
    margin: 0;
    color: var(--guest-navy-deep);
    font-size: 23px;
    font-weight: 750;
    line-height: 1.3;
}

.guest-section__heading p {
    margin: 4px 0 0;
    color: var(--guest-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ------------------------------
   Form fields
   ------------------------------ */

.guest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 21px 22px;
}

.guest-field {
    min-width: 0;
}

.guest-field label {
    display: block;
    margin-bottom: 8px;
    color: #173459;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.required {
    color: var(--guest-danger);
}

.guest-field input,
.guest-field select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--guest-border);
    border-radius: 10px;
    outline: none;
    color: var(--guest-text);
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(20, 54, 92, 0.025);
    font-size: 15px;
    line-height: 1.4;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.guest-field input::placeholder {
    color: #8294ad;
    opacity: 1;
}

.guest-field input:hover,
.guest-field select:hover {
    border-color: #aabed7;
}

.guest-field input:focus,
.guest-field select:focus {
    border-color: var(--guest-primary);
    box-shadow: 0 0 0 3px rgba(8, 99, 201, 0.10);
}

.guest-field input:disabled,
.guest-field select:disabled {
    cursor: not-allowed;
    color: #7f90a8;
    background-color: #f0f4f9;
}

.guest-field select {
    padding-right: 36px;
    cursor: pointer;
}

.guest-field small {
    display: block;
    margin-top: 6px;
    color: var(--guest-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* ------------------------------
   Number of guests control
   ------------------------------ */

.guest-counter {
    display: grid;
    grid-template-columns: 46px 44px minmax(40px, 1fr) 44px;
    min-height: 50px;
    overflow: hidden;
    border: 1px solid var(--guest-border);
    border-radius: 10px;
    background: #fff;
}

.guest-counter__icon,
.guest-counter__button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.guest-counter__icon {
    color: var(--guest-muted);
    background: #fff;
}

.guest-counter__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.guest-counter__button {
    min-height: 48px;
    padding: 0;
    border: 0;
    color: var(--guest-navy-deep);
    background: #eef3f9;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.guest-counter__button:hover:not(:disabled) {
    background: #dceafb;
}

.guest-counter__button:active:not(:disabled) {
    background: #cbdff7;
}

.guest-counter__button:disabled {
    color: #9aa9bc;
    cursor: not-allowed;
}

.guest-counter input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 6px;
    border: 0;
    border-radius: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    appearance: textfield;
    -moz-appearance: textfield;
}

.guest-counter input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.guest-counter input::-webkit-inner-spin-button,
.guest-counter input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

/* ------------------------------
   Security information panel
   ------------------------------ */

.guest-security-notice {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid #dfe7f1;
    border-radius: 12px;
    background: #f7f9fc;
}

.guest-security-notice__symbol {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--guest-success);
    background: #e0f6ed;
}

.guest-security-notice__symbol svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.guest-security-notice strong {
    display: block;
    color: var(--guest-text);
    font-size: 14px;
    line-height: 1.45;
}

.guest-security-notice p {
    margin: 3px 0 0;
    color: var(--guest-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ------------------------------
   Submit button
   ------------------------------ */

.guest-form__actions {
    margin-top: 27px;
}

.guest-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 58px;
    padding: 15px 20px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(110deg, #0870dc, #0756b8);
    box-shadow: 0 5px 12px rgba(8, 99, 201, 0.14);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.guest-submit svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.guest-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 7px 16px rgba(8, 99, 201, 0.20);
}

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

.guest-form__notice {
    margin: 11px 0 0;
    color: var(--guest-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/* ------------------------------
   Footer
   ------------------------------ */

.guest-footer {
    padding: 0 20px 26px;
    color: var(--guest-muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.65;
}

.guest-footer p {
    margin: 0;
}

.guest-footer span {
    display: block;
}

/* =========================================================
   LAPTOP / SMALL DESKTOP
   ========================================================= */

@media (min-width: 1200px) {
    .guest-hero {
        min-height: 360px;
    }

    .guest-hero__content {
        padding-top: 26px;
        padding-bottom: 82px;
    }

    .guest-hero__text {
        margin-top: 23px;
    }

    .guest-main {
        margin-top: -42px;
    }

    .guest-form {
        padding: 30px;
    }
}

@media (max-width: 1050px) {
    .guest-main {
        width: min(100% - 36px, 980px);
    }

    .guest-form {
        padding: 25px;
    }

    .guest-grid {
        gap: 20px 18px;
    }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 800px) {
    .guest-container {
        width: min(100% - 32px, 720px);
    }

    .guest-hero {
        min-height: 320px;
        background-position: center, 57% center;
    }

    .guest-hero__content {
        padding-top: 22px;
        padding-bottom: 70px;
    }

    .guest-hero__text {
        max-width: 470px;
        margin-top: 21px;
    }

    .guest-hero__text h1 {
        max-width: 470px;
        font-size: clamp(34px, 5.2vw, 40px);
    }

    .guest-hero__text p {
        max-width: 400px;
        font-size: 15px;
    }

    .guest-main {
        width: min(100% - 32px, 720px);
        margin-top: -34px;
    }

    .guest-form {
        padding: 24px;
        border-radius: 18px;
    }

    .guest-section {
        padding-bottom: 24px;
        margin-bottom: 24px;
    }

    .guest-section__heading {
        margin-bottom: 20px;
    }

    .guest-section__heading h2 {
        font-size: 22px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .guest-container {
        width: calc(100% - 28px);
    }

    .guest-hero {
        min-height: 0;
        background-image:
            linear-gradient(
                90deg,
                rgba(5, 43, 85, 0.97) 0%,
                rgba(8, 56, 105, 0.88) 58%,
                rgba(10, 61, 112, 0.62) 100%
            ),
            url("../imgs/buku-tamu-hero.jpg");
        background-position: center, 61% center;
    }

    .guest-hero__content {
        padding-top: 18px;
        padding-bottom: 58px;
    }

    .guest-hero .guest-brand {
        padding: 7px 9px;
        border-radius: 7px;
    }

    .guest-hero .guest-brand__logo {
        width: 136px;
        max-height: 42px;
    }

    .guest-hero__text {
        max-width: 390px;
        margin-top: 19px;
    }

    .guest-hero__text h1 {
        max-width: 390px;
        font-size: clamp(30px, 7.2vw, 36px);
        line-height: 1.13;
        letter-spacing: -0.45px;
    }

    .guest-hero__text p {
        max-width: 350px;
        margin-top: 10px;
        font-size: 14px;
        line-height: 1.55;
    }

    .guest-main {
        width: calc(100% - 24px);
        margin-top: -25px;
        margin-bottom: 22px;
    }

    .guest-form {
        padding: 20px 17px;
        border-radius: 17px;
        box-shadow: 0 10px 28px rgba(20, 54, 92, 0.08);
    }

    .guest-section {
        padding-bottom: 22px;
        margin-bottom: 22px;
    }

    .guest-section__heading {
        align-items: center;
        gap: 11px;
        margin-bottom: 19px;
    }

    .guest-section__icon {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    .guest-section__icon svg {
        width: 23px;
        height: 23px;
    }

    .guest-section__heading h2 {
        font-size: 19px;
        line-height: 1.3;
    }

    .guest-section__heading p {
        margin-top: 3px;
        font-size: 13px;
        line-height: 1.45;
    }

    .guest-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .guest-field label {
        margin-bottom: 7px;
        font-size: 14px;
    }

    .guest-field input,
    .guest-field select {
        min-height: 52px;
        padding: 12px;
        border-radius: 10px;
        font-size: 16px;
    }

    .guest-field small {
        margin-top: 6px;
        font-size: 12px;
        line-height: 1.5;
    }

    .guest-counter {
        grid-template-columns: 42px 42px minmax(40px, 1fr) 42px;
        min-height: 51px;
    }

    .guest-counter__button,
    .guest-counter input {
        min-height: 49px;
    }

    .guest-counter input {
        font-size: 16px;
    }

    .guest-security-notice {
        align-items: flex-start;
        gap: 11px;
        padding: 13px;
    }

    .guest-security-notice__symbol {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .guest-security-notice strong {
        font-size: 13px;
    }

    .guest-security-notice p {
        font-size: 12px;
    }

    .guest-form__actions {
        margin-top: 23px;
    }

    .guest-submit {
        min-height: 55px;
        padding: 14px 15px;
        gap: 9px;
        border-radius: 10px;
        font-size: 15px;
    }

    .guest-form__notice {
        margin-top: 10px;
        font-size: 12px;
    }

    .guest-footer {
        padding: 0 16px 22px;
        font-size: 11px;
    }
}

/* =========================================================
   SMALL MOBILE (320-380px)
   ========================================================= */

@media (max-width: 380px) {
    .guest-container {
        width: calc(100% - 24px);
    }

    .guest-hero__content {
        padding-top: 16px;
        padding-bottom: 53px;
    }

    .guest-hero .guest-brand__logo {
        width: 126px;
        max-height: 39px;
    }

    .guest-hero__text {
        margin-top: 17px;
    }

    .guest-hero__text h1 {
        font-size: 29px;
        letter-spacing: -0.35px;
    }

    .guest-hero__text p {
        max-width: 300px;
        font-size: 13px;
    }

    .guest-main {
        width: calc(100% - 20px);
        margin-top: -22px;
    }

    .guest-form {
        padding: 17px 13px;
        border-radius: 15px;
    }

    .guest-section__heading {
        gap: 9px;
    }

    .guest-section__icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .guest-section__heading h2 {
        font-size: 18px;
    }

    .guest-section__heading p {
        font-size: 12px;
    }

    .guest-grid {
        gap: 16px;
    }

    .guest-counter {
        grid-template-columns: 36px 38px minmax(30px, 1fr) 38px;
    }

    .guest-field input,
    .guest-field select {
        font-size: 16px;
    }
}

/* =========================================================
   WIDE / SHORT SCREENS
   ========================================================= */

@media (min-width: 801px) and (max-height: 800px) {
    .guest-hero {
        min-height: 320px;
    }

    .guest-hero__content {
        padding-top: 20px;
        padding-bottom: 68px;
    }

    .guest-hero__text {
        margin-top: 18px;
    }

    .guest-main {
        margin-top: -34px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =========================================================
   FINAL USABILITY DETAILS
   ========================================================= */

/* Keep form controls comfortable to tap and prevent long text from
   forcing horizontal overflow on narrow screens. */
.guest-field,
.guest-section__heading > div {
    min-width: 0;
}

.guest-field input,
.guest-field select,
.guest-counter,
.guest-security-notice {
    max-width: 100%;
}

.guest-field input,
.guest-field select {
    overflow-wrap: anywhere;
}

/* Keep visible keyboard focus clear for keyboard and switch users. */
.guest-counter__button:focus-visible,
.guest-submit:focus-visible {
    outline: 3px solid rgba(8, 99, 201, 0.35);
    outline-offset: 3px;
    position: relative;
    z-index: 1;
}

/* Mobile browsers can zoom inputs below 16px. Use a readable size. */
@media (max-width: 600px) {
    .guest-field input,
    .guest-field select {
        font-size: 16px;
    }

    .guest-field input::placeholder {
        font-size: 14px;
    }
}

/* Respect safe areas on phones with display cutouts. */
.guest-footer {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
}

@media (prefers-contrast: more) {
    .guest-field input,
    .guest-field select,
    .guest-counter,
    .guest-security-notice {
        border-color: #8799b2;
    }
}

/* =========================================================
   VALIDASI FORM & PESAN STATUS
   ========================================================= */

/* Ringkasan status dari server */
.guest-alert {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--guest-border);
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.guest-alert--error {
    color: #991b1b;
    border-color: #fca5a5;
    background: #fef2f2;
    scroll-margin-top: 1rem;
}

.guest-alert--success {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
    scroll-margin-top: 1rem;
}

.guest-alert p {
    margin: .35rem 0 0;
}

.guest-alert strong {
    font-weight: 700;
}

/* Penanda field yang gagal validasi server-side */
.guest-field .is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .10);
}

.guest-field select.is-invalid,
.guest-field input.is-invalid {
    background-color: #fffafa;
}

.guest-field .is-invalid:focus {
    outline-color: #dc2626;
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

.guest-field .field-error {
    display: block;
    margin-top: .4rem;
    color: #b91c1c;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.guest-field .field-error::before {
    content: "ⓘ ";
    font-weight: 700;
}

.guest-field [aria-invalid="true"] {
    border-color: #dc2626;
}

/* Saat browser diarahkan otomatis ke field atau pesan error */
.guest-field,
.guest-section,
.guest-alert {
    scroll-margin-top: 1rem;
}

.guest-field input,
.guest-field select,
.guest-counter {
    scroll-margin-top: 1rem;
}

/* =========================================================
   CLOUDFLARE TURNSTILE
   ========================================================= */

.guest-section--security {
    min-width: 0;
}

.guest-security-notice {
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    overflow: hidden;
}

.guest-security-notice .cf-turnstile {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.guest-security-notice__text {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.guest-security-notice [role="alert"] {
    width: 100%;
    color: #991b1b;
}

.guest-security-notice--error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.guest-security-notice--error .guest-security-notice__text {
    color: #991b1b;
}

/* Tombol tidak terlihat aktif saat request sedang dikirim */
.guest-submit:disabled {
    opacity: .72;
    cursor: wait;
    filter: none;
    box-shadow: none;
}

/* =========================================================
   RESPONSIVE VALIDATION & SECURITY
   ========================================================= */

@media (max-width: 600px) {
    .guest-alert {
        padding: .85rem .9rem;
        border-radius: 10px;
        font-size: 14px;
        line-height: 1.5;
    }

    .guest-field .field-error {
        font-size: 12px;
    }

    .guest-security-notice {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .guest-security-notice .cf-turnstile {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .guest-security-notice__text {
        flex-basis: auto;
        width: 100%;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .guest-security-notice {
        padding: 10px;
    }

    .guest-alert {
        padding: .75rem;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-field,
    .guest-alert {
        scroll-behavior: auto !important;
    }
}


/* =========================================================
   FINAL OVERRIDES - FIELD-LOCAL ERRORS & TURNSTILE
   Diselaraskan dengan form.php dan controller Buku_tamu.php
   ========================================================= */

/* Error umum hanya untuk masalah sistem; validasi field tetap lokal. */
.guest-alert[role="alert"] {
    color: #991b1b;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Field yang ditolak validasi server-side. */
.guest-field input.is-invalid,
.guest-field select.is-invalid,
.guest-field textarea.is-invalid,
.guest-field [aria-invalid="true"] {
    border-color: var(--guest-danger) !important;
    background-color: #fffafa;
    box-shadow: 0 0 0 3px rgba(217, 45, 54, 0.11);
}

.guest-field input.is-invalid:focus,
.guest-field select.is-invalid:focus,
.guest-field textarea.is-invalid:focus,
.guest-field [aria-invalid="true"]:focus {
    border-color: var(--guest-danger) !important;
    outline: 2px solid rgba(217, 45, 54, 0.14);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(217, 45, 54, 0.12);
}

/* Pesan spesifik di bawah field. */
.guest-field .field-error {
    display: block;
    width: 100%;
    margin: 0.4rem 0 0;
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.guest-field .field-error::before {
    content: "ⓘ ";
    font-weight: 700;
}

/* Error jumlah orang: letakkan di bawah seluruh counter, bukan di dalam grid-nya. */
.guest-field > .field-error {
    clear: both;
}

/* Scroll otomatis setelah validasi gagal, dengan jarak yang nyaman. */
.guest-field,
.guest-section,
.guest-alert,
.guest-security-notice {
    scroll-margin-top: 1.25rem;
}

/* Pesan error Turnstile hanya tampil di panel keamanan. */
.guest-security-notice--error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.guest-security-notice--error .guest-security-notice__text,
.guest-security-notice--error .field-error,
.guest-security-notice--error [role="alert"] {
    color: #991b1b;
}

.guest-security-notice .field-error,
.guest-security-notice [role="alert"] {
    display: block;
    flex: 1 0 100%;
    width: 100%;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* Turnstile tidak boleh menyebabkan overflow horizontal di layar sempit. */
.guest-section--security,
.guest-security-notice,
.guest-security-notice > * {
    min-width: 0;
}

.guest-security-notice .cf-turnstile {
    max-width: 100%;
}

.guest-submit:disabled {
    opacity: 0.72;
    cursor: wait;
    box-shadow: none;
    filter: none;
}

@media (max-width: 600px) {
    .guest-field .field-error,
    .guest-security-notice .field-error,
    .guest-security-notice [role="alert"] {
        font-size: 12px;
    }

    .guest-security-notice {
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-field,
    .guest-section,
    .guest-alert,
    .guest-security-notice {
        scroll-behavior: auto !important;
    }
}
