/* ============================================================
   Tex Software - CONEXPO Rolex Raffle
   Design: Industrial modern. Black + Red + Gold.
   Target: iPad (768x1024 portrait, 1024x768 landscape)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red: #b50201;
    --blue: #002969;
    --yellow: #ffcc02;
    --black: #000000;
    --white: #ffffff;
    --gold: #d4a847;
    --gold-light: #e8c96a;
}

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

body {
    font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--black);
    color: var(--white);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--red);
    color: var(--white);
}

/* --- Brand Bar (top red stripe) --- */
.brand-bar {
    background: var(--red);
    display: flex;
    align-items: center;
    padding: 10px 32px;
    gap: 16px;
}

.brand-bar-text {
    font-family: "Cairo", sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--white);
}

.brand-bar-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
}

.brand-bar-event {
    font-family: "Cairo", sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
}

/* --- Main Layout: side-by-side on iPad landscape, stacked on portrait --- */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100% - 38px); /* minus brand bar */
}

/* --- Hero (left panel) --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    border-right: 1px dashed rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.hero-inner {
    text-align: left;
    max-width: 440px;
    transform: translateY(-12%);
}

.hero-eyebrow {
    font-family: "Cairo", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--red);
    margin-bottom: 20px;
}

/* --- Bars (Tex signature element) --- */
.bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.bars-bottom {
    margin-bottom: 0;
    margin-top: 24px;
}

.bar {
    background: var(--red);
}

.bar-1 { height: 2px; width: 60%; }
.bar-2 { height: 4px; width: 80%; }
.bar-3 { height: 6px; width: 100%; }

/* --- Hero Title --- */
.hero-title {
    font-family: "Cairo", sans-serif;
    line-height: 0.9;
    margin-bottom: 20px;
}

.hero-title-line {
    display: block;
    font-weight: 900;
    font-size: 64px;
    letter-spacing: -0.02em;
    color: var(--white);
}

.hero-title-rolex {
    display: block;
    font-weight: 900;
    font-size: 44px;
    letter-spacing: -0.01em;
    color: var(--gold);
    margin-top: 8px;
    text-shadow: 0 0 60px rgba(212, 168, 71, 0.3);
}

.hero-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    max-width: 320px;
}

/* --- Form Panel (right side) --- */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
    position: relative;
}

#raffle-form {
    width: 100%;
    max-width: 440px;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-family: "Cairo", sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

input:not([type="checkbox"]), select {
    width: 100%;
    padding: 14px 16px;
    font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0; /* Industrial. No rounded corners. */
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

input:focus, select:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

input.invalid, select.invalid {
    border-color: var(--red);
    background: rgba(181, 2, 1, 0.08);
}

/* Select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select option {
    background: #111;
    color: var(--white);
}

/* --- Checkbox --- */
.checkbox-group {
    margin-top: 4px;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 1px;
    accent-color: var(--gold);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(212, 168, 71, 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}

.checkbox-label a:hover {
    text-decoration-color: var(--gold);
}

.checkbox-label input[type="checkbox"].invalid {
    outline: 2px solid var(--red);
    outline-offset: 1px;
}

/* --- Submit Button --- */
button[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    font-family: "Cairo", sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--yellow);
    border: none;
    border-radius: 0;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

button[type="submit"]:hover {
    background: #ffd83d;
}

button[type="submit"]:active {
    background: #e6b800;
}

button[type="submit"]:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

/* --- Success State --- */
.hidden {
    display: none;
}

#success-message {
    width: 100%;
    max-width: 440px;
}

.success-inner {
    text-align: center;
    padding: 40px 0;
}

.success-check {
    width: 72px;
    height: 72px;
    border: 3px solid var(--gold);
    color: var(--gold);
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: checkPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-inner h2 {
    font-family: "Cairo", sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 8px;
}

.success-inner p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
}

#reset-btn {
    padding: 12px 32px;
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

#reset-btn:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}

/* --- Error State --- */
#error-message {
    margin-top: 12px;
}

#error-message p {
    font-family: "Cairo", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    text-align: center;
    padding: 10px;
    border: 1px solid rgba(181, 2, 1, 0.3);
    background: rgba(181, 2, 1, 0.08);
}

/* --- iPad Portrait (768px wide) --- */
@media (max-width: 850px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto;
    }

    .hero {
        border-right: none;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
        padding: 40px 32px;
    }

    .hero-inner {
        text-align: center;
        max-width: 100%;
    }

    .hero-eyebrow {
        margin-bottom: 12px;
    }

    .bars {
        margin: 0 auto 16px;
        max-width: 300px;
    }

    .bars .bar-1 { margin-left: auto; margin-right: auto; width: 40%; }
    .bars .bar-2 { margin-left: auto; margin-right: auto; width: 60%; }
    .bars .bar-3 { margin-left: auto; margin-right: auto; width: 80%; }

    .bars-bottom {
        margin-top: 16px;
        margin-bottom: 0;
    }

    .hero-title-line {
        font-size: 48px;
    }

    .hero-title-rolex {
        font-size: 36px;
    }

    .hero-subtitle {
        max-width: 100%;
        margin: 0 auto;
    }

    .form-panel {
        padding: 32px;
    }
}

/* --- Phone (unlikely but handled) --- */
@media (max-width: 500px) {
    .brand-bar {
        padding: 8px 20px;
    }

    .hero {
        padding: 32px 20px;
    }

    .hero-title-line {
        font-size: 36px;
    }

    .hero-title-rolex {
        font-size: 28px;
    }

    .form-panel {
        padding: 24px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    input, select {
        padding: 12px 14px;
    }
}
