:root {
    --bg: #f6eceb;
    --bg-soft: #fff8f7;
    --ink: #1f1716;
    --muted: #6a514f;
    --line: #e3b8b7;
    --panel: rgba(255, 255, 255, 0.96);
    --primary: #be3a34;
    --primary-dark: #9f2f2b;
    --primary-soft: #f4d6d5;
    --blue: #0f2345;
    --danger: #b42318;
    --success: #0f6b3f;
    --shadow: 0 18px 42px rgba(63, 20, 18, 0.12);
    --radius: 8px;
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(190, 58, 52, 0.14), transparent 36%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--primary-dark);
    font-weight: 750;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    color: var(--blue);
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.02;
    margin-bottom: 1rem;
}

h2 {
    color: var(--blue);
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

button,
input,
textarea {
    font: inherit;
}

button {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(190, 58, 52, 0.22);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 0.78rem 1.1rem;
}

button:hover {
    background: var(--primary-dark);
}

.button-link {
    align-items: center;
    background: var(--primary);
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(190, 58, 52, 0.22);
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 0.78rem 1.1rem;
}

.button-link:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

button.secondary {
    background: #334155;
    box-shadow: none;
}

input,
textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    min-height: 46px;
    padding: 0.72rem 0.85rem;
    width: 100%;
}

input:focus,
textarea:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(190, 58, 52, 0.26);
    outline-offset: 2px;
}

fieldset {
    border: 0;
    margin: 1rem 0 0;
    padding: 0;
}

legend,
label {
    color: var(--ink);
    display: block;
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.brand-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(63, 20, 18, 0.08);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    min-height: 82px;
    padding: 0.75rem clamp(1rem, 4vw, 3rem);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand-mark {
    align-items: center;
    display: inline-flex;
    max-width: min(100%, 440px);
    min-width: 0;
    width: 100%;
}

.brand-mark img {
    display: block;
    height: auto;
    width: 100%;
}

.admin-link,
.tabs a {
    background: #fff8f7;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--primary-dark);
    padding: 0.66rem 0.9rem;
    white-space: nowrap;
}

.admin-link:hover,
.tabs a:hover {
    background: var(--primary-soft);
    text-decoration: none;
}

.hero-public {
    align-items: stretch;
    background:
        linear-gradient(90deg, rgba(255, 248, 247, 0.96) 0%, rgba(255, 248, 247, 0.9) 42%, rgba(255, 248, 247, 0.32) 100%),
        url("img/sucre4.jpg") center / cover no-repeat;
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: minmax(0, 720px) minmax(360px, 520px);
    justify-content: center;
    min-height: calc(100vh - 82px);
    padding: clamp(1.25rem, 4vw, 4rem);
}

.hero-copy {
    align-self: center;
    max-width: 760px;
    min-width: 0;
}

.lead {
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    max-width: 690px;
}

.eyebrow {
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.hero-badges span {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--blue);
    font-weight: 800;
    padding: 0.52rem 0.8rem;
}

.hero-agenda {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(227, 184, 183, 0.82);
    border-radius: var(--radius);
    box-shadow: 0 14px 32px rgba(63, 20, 18, 0.08);
    margin-top: 1.35rem;
    max-width: 720px;
    padding: 1.15rem;
}

.hero-agenda h2 {
    margin-bottom: 0.85rem;
}

.signup-panel,
.panel {
    background: var(--panel);
    border: 1px solid rgba(227, 184, 183, 0.88);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.signup-panel {
    align-self: center;
    min-width: 0;
    padding: clamp(1.1rem, 2vw, 1.6rem);
}

.site-shell,
.admin-shell {
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
}

.site-shell {
    max-width: 1180px;
}

.admin-shell {
    max-width: 1520px;
}

.content-grid,
.admin-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.participants-admin-grid {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.site-shell.content-grid {
    grid-template-columns: 1fr;
}

.admin-grid > .table-panel:only-child {
    grid-column: 1 / -1;
}

.panel {
    min-width: 0;
    padding: 1.25rem;
}

.agenda {
    display: grid;
    gap: 0.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.agenda li {
    border-left: 4px solid var(--primary);
    padding-left: 0.85rem;
}

.support-panel {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 180px minmax(0, 1fr);
}

.support-panel img {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.signup-form {
    display: grid;
    gap: 0.8rem;
}

.session-list {
    display: grid;
    gap: 0.7rem;
}

.session-option {
    align-items: flex-start;
    background: #fffaf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    margin: 0;
    padding: 0.9rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.session-option:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(63, 20, 18, 0.08);
    transform: translateY(-1px);
}

.session-option input {
    accent-color: var(--primary);
    margin-top: 0.24rem;
    min-height: auto;
    width: auto;
}

.session-option small,
.teams-card small,
.muted {
    color: var(--muted);
    display: block;
}

.section-heading,
.confirmation,
.stat-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.links-panel {
    margin-bottom: 1rem;
}

.confirmation-view {
    align-items: center;
    display: grid;
    min-height: calc(100vh - 178px);
}

.confirmation-panel h1 {
    font-size: clamp(1.85rem, 4vw, 2.9rem);
    margin-bottom: 0.55rem;
}

.links-panel > .section-heading h2 {
    margin-bottom: 0.25rem;
}

.teams-list {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.teams-card {
    background:
        linear-gradient(180deg, #ffffff 0%, #fff8f7 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    display: block;
    min-height: 116px;
    padding: 1rem;
}

.teams-card::before {
    background: var(--primary);
    border-radius: 999px;
    content: "";
    display: block;
    height: 6px;
    margin-bottom: 0.8rem;
    width: 44px;
}

.teams-card.is-selected {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary), 0 12px 26px rgba(63, 20, 18, 0.1);
}

.locked-links,
.confirmation {
    background: #fff8f7;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    padding: 1rem;
}

.confirmation {
    border-style: solid;
    color: var(--ink);
    display: block;
}

.confirmation span {
    display: block;
    margin-top: 0.45rem;
}

.teams-heading {
    margin-top: 1.25rem;
}

.alert {
    border-radius: var(--radius);
    font-weight: 800;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.alert-success {
    background: #e8f7ef;
    color: var(--success);
}

.alert-error {
    background: #fff1f0;
    color: var(--danger);
}

.corp-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 1rem clamp(1rem, 4vw, 3rem);
}

.corp-footer img {
    display: block;
    height: auto;
    margin: 0 auto;
    max-width: min(100%, 980px);
}

.theme-login {
    background: #f2f3f5;
}

.login-screen {
    display: grid;
    min-height: 100vh;
    padding: clamp(1.5rem, 4vw, 3rem);
    place-items: center;
}

.login-panel {
    display: grid;
    gap: 0.9rem;
    max-width: 480px;
    padding: clamp(1.2rem, 3vw, 2rem);
    width: 100%;
}

.login-logo {
    display: block;
    height: auto;
    margin-bottom: 0.6rem;
    max-width: 100%;
}

.theme-admin {
    background:
        radial-gradient(circle at 12% 8%, rgba(190, 58, 52, 0.12), transparent 36%),
        #f7efee;
}

.admin-brand-bar {
    position: sticky;
}

.admin-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-header h1 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: 0;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.table-panel {
    min-width: 0;
}

.table-panel-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.table-panel-heading h2 {
    margin-bottom: 0;
}

.table-count {
    background: #fff3f1;
    border: 1px solid rgba(190, 58, 52, 0.16);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.stack-form {
    align-content: start;
    display: grid;
    gap: 0.85rem;
}

.stack-form label:not(.check-row) input,
.stack-form label:not(.check-row) textarea {
    display: block;
    margin-top: 0.45rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 100%;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    overflow-wrap: break-word;
    padding: 0.78rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #fff8f7;
    color: var(--blue);
    font-size: 0.82rem;
    text-transform: uppercase;
}

tr:hover td {
    background: rgba(255, 248, 247, 0.62);
}

.participants-table {
    min-width: 940px;
    table-layout: auto;
}

.participants-table th:nth-child(1),
.participants-table td:nth-child(1) {
    width: 140px;
}

.participants-table th:nth-child(2),
.participants-table td:nth-child(2) {
    min-width: 250px;
}

.participants-table th:nth-child(3),
.participants-table td:nth-child(3) {
    min-width: 280px;
}

.participants-table th:nth-child(4),
.participants-table td:nth-child(4) {
    width: 140px;
}

.participants-table th:nth-child(5),
.participants-table td:nth-child(5) {
    width: 130px;
}

.participants-table td:nth-child(1),
.participants-table td:nth-child(4) {
    white-space: nowrap;
}

.participants-table tbody td {
    padding-bottom: 0.95rem;
    padding-top: 0.95rem;
}

.participant-name-cell {
    min-width: 0;
}

.participant-name-cell strong,
.participant-name-cell span {
    display: block;
}

.participant-name-cell strong {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin-bottom: 0.18rem;
}

.participant-name-cell span,
.participant-mail-cell {
    color: var(--muted);
    line-height: 1.4;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    white-space: nowrap;
}

.actions form {
    align-items: center;
    display: flex;
    margin: 0;
}

.link-button {
    background: transparent;
    box-shadow: none;
    color: var(--danger);
    min-height: auto;
    padding: 0;
}

.link-button:hover {
    background: transparent;
    text-decoration: underline;
}

.icon-button {
    align-items: center;
    background: #fff8f7;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(63, 20, 18, 0.06);
    color: var(--blue);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    line-height: 0;
    min-height: 40px;
    padding: 0;
    vertical-align: middle;
    width: 40px;
}

.icon-button:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

.icon-button svg {
    display: block;
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.icon-button-danger {
    color: var(--danger);
}

.icon-button-danger:hover {
    background: #fff1f0;
    border-color: var(--danger);
    color: var(--danger);
}

.check-row {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.check-row input {
    accent-color: var(--primary);
    min-height: auto;
    width: auto;
}

.stats-grid {
    display: grid;
    gap: 1rem;
}

.stat-heading strong {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 2rem;
    height: 64px;
    justify-content: center;
    min-width: 64px;
    padding: 0 0.7rem;
}

@media (max-width: 920px) {
    .hero-public,
    .content-grid,
    .admin-grid,
    .login-screen {
        grid-template-columns: 1fr;
    }

    .hero-public {
        min-height: auto;
    }

    .teams-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .brand-bar,
    .admin-header,
    .section-heading,
    .confirmation,
    .stat-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .brand-mark img {
        width: min(100%, 330px);
    }

    .admin-link {
        align-self: flex-start;
    }

    .hero-public {
        padding: 1.1rem;
    }

    .hero-copy,
    .signup-panel {
        max-width: 100%;
        width: auto;
    }

    .session-option span {
        min-width: 0;
    }

    .support-panel {
        grid-template-columns: 1fr;
    }

    .support-panel img {
        max-height: 180px;
    }

    .table-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
