:root {
    --navy: #052a47;
    --navy-2: #0a4367;
    --cyan: #1cb9d8;
    --cyan-light: #85e4ef;
    --yellow: #fff500;
    --yellow-2: #f5df00;
    --white: #ffffff;
    --text: #09283e;
    --muted: #6f8290;
    --card: rgba(255,255,255,.96);
    --shadow: 0 24px 70px rgba(4, 33, 56, .25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(133, 228, 239, .55), transparent 30%),
        radial-gradient(circle at 90% 20%, rgba(255, 245, 0, .22), transparent 26%),
        linear-gradient(145deg, #eafcff 0%, #89dfec 42%, #0c587d 100%);
}

.login-page {
    min-height: 100vh;
    padding: 28px;
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(1220px, 100%);
    display: grid;
    gap: 18px;
}

.hero-card,
.login-card {
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.hero-card {
    background: var(--navy);
    border: 2px solid rgba(255,255,255,.4);
}

.cover {
    display: block;
    width: 100%;
    height: auto;
}

.login-card {
    width: min(520px, calc(100% - 28px));
    margin: -2px auto 0;
    padding: 34px;
    background: var(--card);
    border: 1px solid rgba(255,255,255,.65);
    backdrop-filter: blur(12px);
}

.login-heading { text-align: center; }

.eyebrow {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--yellow);
    color: #0b3048;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
}

h1 {
    margin: 14px 0 8px;
    color: var(--navy);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
}

.login-heading p {
    margin: 0 0 26px;
    color: var(--muted);
    line-height: 1.55;
}

form {
    display: grid;
    gap: 10px;
}

label {
    margin-top: 6px;
    font-weight: 800;
    color: var(--navy);
}

input {
    width: 100%;
    height: 54px;
    border: 2px solid #cfe6ed;
    border-radius: 14px;
    padding: 0 15px;
    font-size: 17px;
    color: #082b42;
    background: #f9feff;
    outline: none;
    transition: .2s ease;
}

input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(28,185,216,.14);
    background: white;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 72px;
}

.show-pass {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: #e9f7fa;
    color: var(--navy);
    font-weight: 800;
    padding: 8px 10px;
    cursor: pointer;
}

.primary-btn {
    margin-top: 14px;
    min-height: 56px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--yellow), #ffd900);
    color: #092b43;
    font-size: 17px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(215, 188, 0, .28);
    transition: transform .15s ease, filter .15s ease;
}

.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.02); }
.primary-btn:active { transform: translateY(0); }

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff0ef;
    border: 1px solid #ffc4be;
    color: #a12c24;
    font-weight: 700;
    text-align: center;
}

.login-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2eef2;
    text-align: center;
    color: #77909e;
    font-size: 13px;
    font-weight: 700;
}

/* PORTAL */
.portal-page {
    background: #eef8fb;
    height: 100vh;
    overflow: hidden;
}

.portal-header {
    height: auto;
    background: var(--navy);
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
    position: relative;
    z-index: 10;
}

.portal-cover {
    width: 100%;
    display: block;
    max-height: 205px;
    object-fit: cover;
    object-position: center;
}

.portal-bar {
    min-height: 58px;
    padding: 8px 18px;
    background: linear-gradient(90deg, #062e4b, #0a5a7f);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-bar > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.portal-bar strong {
    font-size: 18px;
}

.portal-bar span {
    color: #bfeef6;
    font-size: 13px;
}

.logout-btn {
    flex: none;
    text-decoration: none;
    background: var(--yellow);
    color: #092b43;
    padding: 9px 15px;
    border-radius: 10px;
    font-weight: 900;
}

.kiosk-wrap {
    position: relative;
    height: calc(100vh - min(205px, 15vw) - 58px);
    min-height: 320px;
    background: white;
}

#raceKiosk {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: white;
}

.iframe-message {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    background: white;
    color: var(--navy);
    z-index: 2;
    transition: opacity .25s ease, visibility .25s ease;
}

.iframe-message.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    width: 42px;
    height: 42px;
    border: 4px solid #d9f2f6;
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
    .login-page { padding: 12px; }
    .login-shell { gap: 12px; }
    .hero-card, .login-card { border-radius: 18px; }
    .login-card {
        width: 100%;
        padding: 24px 18px;
    }

    .portal-cover {
        max-height: 124px;
        min-height: 92px;
        object-fit: cover;
    }

    .portal-bar {
        min-height: 54px;
        padding: 7px 11px;
    }

    .portal-bar strong { font-size: 15px; }
    .portal-bar span { display: none; }
    .logout-btn { padding: 8px 12px; font-size: 13px; }

    .kiosk-wrap {
        height: calc(100vh - 124px - 54px);
    }
}

@media (max-width: 430px) {
    .portal-cover { max-height: 96px; min-height: 80px; }
    .kiosk-wrap { height: calc(100vh - 96px - 54px); }
}
