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

body.reg-page {
    margin: 0;
    min-height: 100vh;
    background: #e8ecf8;
    color: #2a2f3d;
    font-family: 'IBM Plex Sans Thai', 'Sarabun', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

.reg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #12114a;
    box-shadow: 0 4px 20px rgba(18, 17, 74, 0.25);
}

.reg-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 14px 20px;
}

.reg-header__logo img {
    display: block;
    height: 52px;
    width: auto;
}

.reg-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.reg-header__toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: #fff;
    border-radius: 2px;
}

.reg-header__nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 22px;
}

.reg-header__link {
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.reg-header__link:hover {
    color: #f9b8d8;
    text-decoration: none;
}

.reg-header__dropdown {
    position: relative;
}

.reg-header__dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(18, 17, 74, 0.18);
    padding: 8px 0;
    z-index: 200;
}

.reg-header__dropdown-menu.is-open {
    display: block;
}

.reg-header__dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #12114a;
    text-decoration: none;
    font-size: 0.88rem;
}

.reg-header__dropdown-menu a:hover {
    background: #f4f6fc;
    color: #f20487;
}

.reg-main {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}

.reg-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 48px rgba(18, 17, 74, 0.1);
    overflow: hidden;
}

.reg-card__layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    align-items: stretch;
}

.reg-card__poster {
    background: #f4f6fc;
    border-right: 1px solid #e8ecf4;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.reg-card__poster-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    font: inherit;
    text-align: left;
}

.reg-card__poster-btn img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 8px solid #fff;
    box-shadow: 0 8px 28px rgba(18, 17, 74, 0.12);
    object-fit: cover;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reg-card__poster-btn:hover img {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(18, 17, 74, 0.18);
}

.reg-card__poster-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5c6378;
}

.reg-card__poster-btn:hover .reg-card__poster-zoom {
    color: #12114a;
}

.reg-card__poster-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 280px;
    color: #9aa3b8;
    font-size: 0.9rem;
}

.reg-card__poster-empty i {
    font-size: 2rem;
}

.reg-poster-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.reg-poster-lightbox.is-open {
    display: flex;
}

body.reg-poster-lightbox-open {
    overflow: hidden;
}

.reg-poster-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 17, 74, 0.82);
    backdrop-filter: blur(4px);
}

.reg-poster-lightbox__close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.reg-poster-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.reg-poster-lightbox__dialog {
    position: relative;
    z-index: 1;
    max-width: min(920px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.reg-poster-lightbox__dialog img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 48px);
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    object-fit: contain;
}

.reg-poster-lightbox__caption {
    margin: 0;
    padding: 0 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.reg-card__content {
    padding: 36px 40px 40px;
    min-width: 0;
}

.reg-head {
    text-align: center;
}

.reg-head__title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #12114a;
    line-height: 1.35;
}

.reg-head__event {
    margin: 12px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f20487;
    line-height: 1.45;
}

.reg-meta {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    text-align: left;
}

.reg-meta li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: #3d4251;
    line-height: 1.65;
}

.reg-meta img {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
}

.reg-divider {
    border: 0;
    border-top: 1px solid #e4e8f2;
    margin: 28px auto;
    width: 70%;
}

.reg-notice__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #12114a;
}

.reg-notice__title img {
    width: 22px;
    height: 22px;
}

.reg-notice__box {
    margin: 0;
    padding: 18px 20px 18px 48px;
    background: #f4f6fc;
    border-radius: 10px;
    position: relative;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.7;
}

.reg-notice__box .fa-quote-left {
    position: absolute;
    left: 16px;
    top: 16px;
    color: #9aa3b8;
    font-size: 1.1rem;
}

.reg-notice__box a {
    color: #f20487;
}

.reg-notice__cite,
.reg-notice__box cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
    color: #12114a;
}

.reg-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 28px 0 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #12114a;
}

.reg-section-title img {
    width: 22px;
    height: 22px;
}

.reg-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.reg-alert {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.reg-alert--error {
    background: #fdecec;
    border: 1px solid #f5c2c7;
    color: #9b1c1c;
}

.reg-alert ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.reg-alert li {
    margin-bottom: 4px;
}

.reg-field-error {
    color: #9b1c1c;
    font-size: 0.88rem;
    margin-top: 6px;
}

.reg-form .form-control.is-invalid,
.reg-form select.is-invalid {
    border-color: #c62828;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.12);
}

.reg-form .option-box.is-invalid {
    outline: 2px solid rgba(198, 40, 40, 0.35);
    outline-offset: 4px;
    border-radius: 8px;
}

.reg-form .form-group {
    margin-bottom: 20px;
}

.reg-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #12114a;
}

.reg-form .form-control {
    height: 48px;
    border-radius: 8px;
    border: 1px solid #d5dbe8;
    font-size: 0.92rem;
    box-shadow: none;
}

.reg-form .form-control:focus {
    border-color: #12114a;
    box-shadow: 0 0 0 3px rgba(18, 17, 74, 0.1);
}

.reg-upload__hint {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: #5a6278;
    line-height: 1.5;
}

.reg-upload__hint a {
    color: #12114a;
    font-weight: 600;
}

.reg-form .option-box .radio-box {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    margin-top: 6px;
}

.reg-form .list-style-four {
    padding-left: 20px;
    margin: 0;
    color: #555;
}

.reg-form .list-style-four li {
    margin-bottom: 6px;
}

#RiddleTeamsWrap {
    width: 100%;
    margin-bottom: 8px;
}

.riddle-team-block {
    margin-bottom: 18px;
    padding-top: 4px;
}

.riddle-team-block__title {
    margin: 0 0 12px;
    color: #12114a;
}

.riddle-member-field {
    margin-bottom: 12px;
}

.reg-submit {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 8px auto 0;
    padding: 14px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #f20487 0%, #c9036d 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(242, 4, 135, 0.35);
    color: #fff;
}

.reg-preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 20px;
    padding: 16px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff8e6 0%, #fff3cc 100%);
    border: 1px solid #f0d878;
    color: #6b4f00;
}

.reg-preview-banner i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.reg-preview-banner strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.reg-preview-banner p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.reg-form--preview .form-control:disabled,
.reg-submit--disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.reg-submit--disabled {
    background: #9aa3b8;
    box-shadow: none;
}

@media (max-width: 991px) {
    .reg-card__layout {
        grid-template-columns: 1fr;
    }

    .reg-card__poster {
        border-right: 0;
        border-bottom: 1px solid #e8ecf4;
        padding: 20px 20px 0;
    }

    .reg-card__poster img {
        max-width: 280px;
        margin: 0 auto;
    }

    .reg-card__content {
        padding: 24px 20px 28px;
    }
}

@media (max-width: 767px) {
    .reg-header__toggle {
        display: flex;
    }

    .reg-header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #12114a;
        padding: 12px 20px 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .reg-header__nav.is-open {
        display: flex;
    }

    .reg-header__nav .reg-header__link {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .reg-header__dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.06);
        margin-top: 4px;
    }

    .reg-header__dropdown-menu a {
        color: #fff;
    }

    .reg-header__inner {
        position: relative;
        flex-wrap: wrap;
    }

    .reg-head__title {
        font-size: 1.2rem;
    }

    .reg-header__logo img {
        height: 44px;
    }
}

.reg-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.reg-loading.is-open {
    display: flex;
}

.reg-loading-open {
    overflow: hidden;
}

.reg-loading__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 17, 74, 0.62);
}

.reg-loading__dialog {
    position: relative;
    width: min(100%, 360px);
    padding: 28px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(18, 17, 74, 0.28);
    text-align: center;
}

.reg-loading__spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    border: 4px solid rgba(242, 4, 135, 0.18);
    border-top-color: #f20487;
    border-radius: 50%;
    animation: reg-loading-spin 0.85s linear infinite;
}

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

.reg-loading__title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #12114a;
}

.reg-loading__text {
    margin: 0;
    font-size: 0.92rem;
    color: #5a5878;
    line-height: 1.5;
}

.reg-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
