:root {
    --cam4-orange: #fc541d;
    --panel: #17191c;
    --panel-raised: #22262a;
    --border: #373c41;
    --muted: #aeb4ba;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(252, 84, 29, .22), transparent 34rem),
        #08090a;
    color: #fff;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell { width: min(100% - 2rem, 680px); margin: 0 auto; padding: 2.5rem 0 1.5rem; }
.registration-card { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: 0 22px 70px rgba(0, 0, 0, .45); }
.hero { padding: 2.5rem 2.5rem 2.25rem; text-align: center; background: linear-gradient(145deg, #32383d, #1e2124); border-bottom: 1px solid var(--border); }
.logo { display: block; width: 216px; max-width: 60%; height: auto; margin: 0 auto 1.75rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--cam4-orange); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.65rem); font-weight: 800; letter-spacing: -.035em; }
.hero-copy { max-width: 31rem; margin: .8rem auto 0; color: var(--muted); }
.form-panel { padding: 2.25rem 2.5rem 2.5rem; }
.back-to-contests { margin-bottom: 1.25rem; border-color: #6c757d; background: #343a40; color: #fff; font-weight: 700; }
.back-to-contests:hover, .back-to-contests:focus { border-color: #868e96; background: #495057; color: #fff; }
.history-card { margin-top: 1rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 36px rgba(0, 0, 0, .28); }
.registration-list { margin-bottom: 1.75rem; }
.history-card .registration-list:last-child { margin-bottom: 0; }
.registration-list h2 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 800; }
.registration-rows { display: grid; gap: .65rem; }
.registration-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-raised); }
.active-registration { border-color: rgba(25, 135, 84, .5); background: rgba(25, 135, 84, .12); }
.registration-row-copy { display: grid; gap: .15rem; min-width: 0; }
.registration-row-copy strong { overflow-wrap: anywhere; }
.registration-row-copy span { color: var(--muted); font-size: .78rem; }
.registration-status { flex: none; color: var(--muted); font-size: .75rem; font-weight: 700; }
.registration-row-actions { display: flex; align-items: center; gap: .75rem; flex: none; }
.registration-details-link { white-space: nowrap; }
.inline-unregister-form { flex: none; }
.inline-unregister-form .btn, .inline-reregister-form .btn { white-space: nowrap; }
.form-control, .form-select { min-height: 58px; border-color: #555c62; background-color: #fff; color: #161719; }
.form-control:disabled { border-color: #7b8186; background-color: #dfe2e4; color: #34383b; opacity: 1; }
.locked-input { padding-right: 3.25rem !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%2334383b'%3E%3Cpath d='M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm120-560h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
.form-floating > label { color: #2d3134; }
.form-help { color: var(--muted); font-size: .8rem; }
.contest-page-heading { margin-bottom: 1.25rem; }
.contest-page-heading h2 { margin: 0 0 .45rem; font-size: 1.55rem; font-weight: 700; }
.contest-page-heading p { margin: 0 0 .3rem; color: var(--muted); font-size: .88rem; }
.contest-page-heading p:last-child { margin-bottom: 0; }
.contest-page-heading strong { color: #fff; }
.contest-details { display: grid; gap: .8rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-raised); color: #d6dade; font-size: .86rem; }
.contest-timing { display: flex; justify-content: space-between; gap: .75rem; }
.contest-timing strong { flex: none; color: #fff; }
.contest-description { margin: 0; padding-top: .75rem; border-top: 1px solid var(--border); color: #d6dade; line-height: 1.55; white-space: pre-line; }
.contest-external-link { width: fit-content; }
.agreements { display: grid; gap: 1rem; }
.registered-state { display: grid; gap: .2rem; padding: 1rem; border: 1px solid rgba(25, 135, 84, .5); border-radius: 10px; background: rgba(25, 135, 84, .14); }
.registered-state strong { color: #75d4a5; }
.registered-state span { color: #d7e5de; font-size: .9rem; }
.form-check { min-height: 1.5rem; padding-left: 2rem; }
.form-check-input { width: 1.2rem; height: 1.2rem; margin-left: -2rem; border-color: #899097; background-color: transparent; }
.form-check-input:checked { border-color: var(--cam4-orange); background-color: var(--cam4-orange); }
.form-check-label { color: #e3e5e7; font-size: .92rem; line-height: 1.45; }
a { color: var(--cam4-orange); font-weight: 700; text-decoration: none; }
a:hover { color: #ff7446; text-decoration: underline; }
.btn.btn-primary { min-height: 52px; border-color: var(--cam4-orange); background: var(--cam4-orange); font-weight: 800; }
.btn.btn-primary:hover, .btn.btn-primary:focus { border-color: #e94611; background: #e94611; }
.btn.btn-outline-danger { min-height: 52px; border-color: #b6424e; background: #5f252b; color: #fff; font-weight: 800; }
.btn.btn-outline-danger:hover, .btn.btn-outline-danger:focus { border-color: #dc3545; background: #b02a37; color: #fff; }
.btn.btn-outline-success { border-color: #31835a; background: #1f5538; color: #fff; font-weight: 800; }
.btn.btn-outline-success:hover, .btn.btn-outline-success:focus { border-color: #3fae79; background: #28774f; color: #fff; }
.registration-row-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; height: 38px; }
.alert { border: 0; font-weight: 600; }
.page-footer { padding: 1.25rem 1rem 0; color: #858b90; text-align: center; font-size: .72rem; }
.page-footer p { margin: .25rem 0; }
.page-footer span { margin: 0 .35rem; }

.embed-mode { min-height: 0; background: var(--panel); }
.embed-mode .page-shell { width: 100%; padding: 0; }
.embed-mode .registration-card { border: 0; border-radius: 0; box-shadow: none; }
.embed-mode .history-card { margin-top: .75rem; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
.embed-heading { padding: 1.35rem 1.5rem 0; font-size: 1.45rem; }
.embed-mode .form-panel { padding: 1.25rem 1.5rem 1.5rem; }

@media (max-width: 575.98px) {
    .page-shell { width: min(100% - 1rem, 680px); padding-top: .5rem; }
    .registration-card { border-radius: 12px; }
    .hero { padding: 1.75rem 1.25rem; }
    .logo { margin-bottom: 1.25rem; }
    .form-panel { padding: 1.5rem 1.25rem; }
    .contest-timing { flex-direction: column; gap: .25rem; }
    .registration-row { align-items: stretch; flex-direction: column; }
    .registration-row-actions { align-items: stretch; flex-direction: column; }
    .registration-details-link { width: 100%; }
    .inline-unregister-form .btn, .inline-reregister-form .btn { width: 100%; }
}
