* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow-x: hidden;
    background: #ffffff;
}


/* ============================================================
   GENERAL PAGE
   ============================================================ */

.page {
    width: 100%;
    min-height: 100vh;
}


/* ============================================================
   INITIAL PAGE VISIBILITY
   ============================================================ */

/*
 * Keep the preparing and document pages hidden until
 * JavaScript activates them.
 *
 * This prevents the pages from appearing underneath
 * the first screen if JavaScript takes a moment to load.
 */

.page-preparing,
.page-document {
    display: none;
}


/* ============================================================
   DEVICE / TURNSTILE GATES
   ============================================================ */

#accessGate,
#turnstileGate {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 99999;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background-image: url("../assets/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.access-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.48);
}

.access-card {
    position: relative;
    z-index: 2;

    width: 500px;
    max-width: 94vw;

    padding: 42px 35px;

    text-align: center;

    background: rgba(255, 255, 255, 0.97);

    border-radius: 14px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);
}

.access-logo {
    display: block;

    width: auto;
    max-width: 220px;
    max-height: 90px;

    margin: 0 auto 25px;
}

.access-icon,
.security-icon {
    width: 62px;
    height: 62px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ef4444;
    color: #ffffff;

    font-size: 32px;
    font-weight: bold;
}

.security-icon {
    background: #db1c46;
}

.access-card h1 {
    margin-bottom: 15px;

    color: #111827;

    font-size: 28px;
    font-weight: 700;
}

.access-card p {
    margin-bottom: 10px;

    color: #4b5563;

    font-size: 16px;
    line-height: 1.6;
}

.turnstile-container {
    display: flex;

    justify-content: center;

    margin-top: 25px;
}

.turnstile-error {
    color: #dc2626 !important;

    font-size: 14px !important;
}


/* ============================================================
   PREPARING PAGE
   ============================================================ */

.page-preparing {
    align-items: center;
    justify-content: center;

    background: #ffffff;
}

.preparing-content {
    width: 90%;

    text-align: center;
}

.main-logo {
    display: block;

    width: auto;
    max-width: 260px;
    max-height: 110px;

    margin: 0 auto 35px;
}

.preparing-content h1 {
    margin-bottom: 12px;

    color: #111827;

    font-size: 32px;
    font-weight: 600;
}

.preparing-content p {
    color: #6b7280;

    font-size: 16px;
}


/* ============================================================
   SPINNER
   ============================================================ */

.spinner {
    width: 48px;
    height: 48px;

    margin: 30px auto 0;

    border: 5px solid #e5e7eb;

    border-top-color: #eb2535;

    border-radius: 50%;

    animation: spin 1s linear infinite;
}

@keyframes spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* ============================================================
   DOCUMENT PAGE
   ============================================================ */

.page-document {
    position: relative;

    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 30px;

    background-image: url("../assets/background.jpg");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;
}

.background-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.18);
}

.document-card {
    position: relative;
    z-index: 2;

    width: 540px;
    max-width: 94vw;

    padding: 45px 40px;

    text-align: center;

    background: rgba(255, 255, 255, 0.97);

    border-radius: 14px;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.25);
}

.document-logo {
    display: block;

    width: auto;
    max-width: 220px;
    max-height: 90px;

    margin: 0 auto 25px;
}

.document-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #a31f1600;

    color: rgb(214, 34, 34);

    font-size: 32px;
    font-weight: bold;
}

.document-card h1 {
    margin-bottom: 15px;

    color: #111827;

    font-size: 32px;
}

.document-message {
    margin-bottom: 10px;

    color: #374151;

    font-size: 17px;

    line-height: 1.6;
}

.safe-message {
    margin-bottom: 30px;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.primary-button,
.download-button {
    width: 100%;

    min-height: 52px;

    border: none;

    border-radius: 8px;

    cursor: pointer;

    font-size: 16px;

    font-weight: 600;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.primary-button {
    background: #e00c0c;

    color: #ffffff;
}

.primary-button:hover,
.download-button:hover {
    transform: translateY(-1px);

    opacity: 0.92;
}

.primary-button:disabled {
    cursor: not-allowed;

    opacity: 0.7;
}


/* ============================================================
   COMPLETE PAGE
   ============================================================ */

.page-complete {
    display: none;

    min-height: 100vh;

    background: #ffffff;
}

.complete-container {
    width: 100%;
    max-width: 650px;

    min-height: 100vh;

    margin: 0 auto;

    padding: 70px 25px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;
}

.complete-logo {
    width: auto;

    max-width: 240px;

    max-height: 100px;

    margin-bottom: 35px;
}

.success-check {
    width: 82px;
    height: 82px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 25px;

    border-radius: 50%;

    background: #ffffff00;

    color: #c91b1b;

    font-size: 42px;

    font-weight: bold;
}

.complete-container h1 {
    margin-bottom: 15px;

    color: #111827;

    font-size: 36px;

    letter-spacing: 0.5px;
}

.success-message {
    margin-bottom: 8px;

    color: #374151;

    font-size: 17px;
}

.download-message {
    margin-bottom: 30px;

    color: #6b7280;

    font-size: 15px;
}

.download-button {
    max-width: 360px;

    margin-bottom: 22px;

    background: #eb3225;

    color: #ffffff;
}

.retry-button {
    display: block;

    padding: 0;

    border: none;

    background: transparent;

    color: #dc2626;

    font-size: 15px;

    font-weight: 700;

    text-decoration: underline;

    cursor: pointer;
}

.retry-button:hover {
    color: #991b1b;
}


/* ============================================================
   LOADING STATE
   ============================================================ */

.primary-button.loading {
    cursor: wait;

    opacity: 0.75;
}


/* ============================================================
   MOBILE SIZING
   ============================================================ */

@media (max-width: 600px) {

    .access-card {
        padding: 35px 25px;
    }

    .access-card h1 {
        font-size: 24px;
    }

    .document-card {
        padding: 35px 25px;
    }

    .document-card h1 {
        font-size: 27px;
    }

    .preparing-content h1 {
        font-size: 27px;
    }

    .complete-container h1 {
        font-size: 30px;
    }

}