/* ============================================================
   EVENT REGISTRATION PAGE  –  /dang-ky-su-kien
   ============================================================ */

/* ── Registration Hero ───────────────────────────────────── */
.er-hero {
    position: relative;
    min-height: 230px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0f2c59 0%, #1a4fa0 55%, #2563eb 100%);
}
.er-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 90% 50%, rgba(56,189,248,.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 80% at 10% 80%, rgba(14,111,173,.35) 0%, transparent 60%);
    z-index: 0;
}
/* Subtle geometric registration motif */
.er-hero__pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .07;
    background-image:
        repeating-linear-gradient(
            45deg,
            #fff 0px, #fff 1px,
            transparent 1px, transparent 28px
        ),
        repeating-linear-gradient(
            -45deg,
            #fff 0px, #fff 1px,
            transparent 1px, transparent 28px
        );
}
.er-hero__inner {
    position: relative;
    z-index: 1;
    padding: 2.5rem 0;
    width: 100%;
}
.er-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}
.er-hero__breadcrumb a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
}
.er-hero__breadcrumb a:hover { color: #fff; text-decoration: underline; }
.er-hero__breadcrumb i { font-size: .6rem; color: rgba(255,255,255,.45); }
.er-hero__breadcrumb span { color: #fff; font-weight: 600; }

.er-hero__body { display: flex; flex-direction: column; gap: .6rem; }

.er-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .3rem .8rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    width: fit-content;
}
.er-hero__title {
    font-size: clamp(1.45rem, 3.5vw, 2.1rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.er-hero__dates {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .84rem;
    color: rgba(255,255,255,.8);
}
.er-hero__dates i { opacity: .75; }

@media (max-width: 600px) {
    .er-hero { min-height: 180px; }
    .er-hero__inner { padding: 1.75rem 0; }
    .er-hero__title { font-size: 1.25rem; }
}

/* ── Layout ──────────────────────────────────────────────── */
.er-section { background: #f8fafc; }

.er-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .er-layout { grid-template-columns: 1fr; }
    .er-sidebar { order: -1; }
}

/* ── Alerts ──────────────────────────────────────────────── */
.er-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1.1rem;
    border-radius: 10px;
    font-size: .9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.er-alert--warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.er-alert--danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.er-alert i { margin-top: 1px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.er-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 8px rgba(0,0,0,.04);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}
.er-card--terms {
    background: #f0f7ff;
    border-color: var(--primary, #0e6fad);
}
.er-card-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1.5px solid #e2e8f0;
}
.er-card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary, #0e6fad), #2563eb);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.er-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

/* ── Fields ──────────────────────────────────────────────── */
.er-field {
    margin-bottom: 1.1rem;
}
.er-field:last-child { margin-bottom: 0; }

.er-label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .4rem;
    letter-spacing: .01em;
}
.er-required { color: #e53e3e; margin-left: 2px; }

.er-control {
    display: block;
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .92rem;
    color: #1e293b;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    line-height: 1.5;
}
.er-control:focus {
    border-color: var(--primary, #0e6fad);
    box-shadow: 0 0 0 3px rgba(14,111,173,.13);
}
.er-control--autofill {
    background: #f0f9ff;
    border-color: #93c5fd;
    color: #374151;
}
.er-control--invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
}
.er-textarea { resize: vertical; min-height: 90px; }

.er-hint {
    font-size: .78rem;
    color: #6b7280;
    margin: .35rem 0 0;
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    line-height: 1.5;
}
.er-hint i { flex-shrink: 0; margin-top: 1px; color: var(--primary, #0e6fad); }

.er-error {
    display: block;
    font-size: .9rem;
    color: #fff;
    margin-top: .3rem;
    background: #ff0000;
    width: 300px;
    border-radius: 10px;
    padding: 3px 10px 2px 10px;
    border: solid 1px #ffffff;
    box-shadow: 0px 0px 4px 2px #f2ff0061;
}

/* ── Select wrapper ──────────────────────────────────────── */
.er-select-wrap {
    position: relative;
}
.er-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    cursor: pointer;
}
.er-select-arrow {
    position: absolute;
    right: .85rem; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: .75rem;
    color: #6b7280;
}

/* ── 2-column row ────────────────────────────────────────── */
.er-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .er-row-2 { grid-template-columns: 1fr; }
}

/* ── DOB ─────────────────────────────────────────────────── */
.er-dob-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1.2fr;
    gap: .75rem;
}
@media (max-width: 480px) {
    .er-dob-row { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
}

/* ── Radio group ─────────────────────────────────────────── */
.er-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}
.er-radio-item {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
.er-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.er-radio-box {
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: border-color .18s;
    background: #fff;
    margin-right: .55rem;
}
.er-radio-item input[type="radio"]:checked ~ .er-radio-box {
    border-color: var(--primary, #0e6fad);
}
.er-radio-item input[type="radio"]:checked ~ .er-radio-box::after {
    content: '';
    width: 8px; height: 8px;
    background: var(--primary, #0e6fad);
    border-radius: 50%;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}
.er-radio-label {
    font-size: .88rem;
    color: #374151;
    user-select: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.er-radio-item input[type="radio"]:checked ~ .er-radio-label {
    color: var(--primary, #0e6fad);
    font-weight: 600;
}

/* ── Checkbox ────────────────────────────────────────────── */
.er-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
    margin-bottom: .5rem;
}
.er-checkbox {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.er-checkbox-box {
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    margin-right: .6rem;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .18s, background .18s;
    background: #fff;
}
.er-checkbox-box i { font-size: .65rem; color: #fff; opacity: 0; transition: opacity .15s; }
.er-checkbox-item input[type="checkbox"]:checked ~ .er-checkbox-box {
    background: var(--primary, #0e6fad);
    border-color: var(--primary, #0e6fad);
}
.er-checkbox-item input[type="checkbox"]:checked ~ .er-checkbox-box i { opacity: 1; }
.er-checkbox-label {
    font-size: .88rem;
    color: #374151;
    line-height: 1.5;
}
.er-link { color: var(--primary, #0e6fad); text-underline-offset: 2px; }

/* ── Found-notice ────────────────────────────────────────── */
.er-found-notice {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .85rem;
    color: #065f46;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}
.er-found-notice i { flex-shrink: 0; margin-top: 2px; }

/* ── reCAPTCHA note ──────────────────────────────────────── */
.er-recaptcha-note {
    font-size: .76rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .75rem 0 1.1rem;
}

/* ── Submit button ───────────────────────────────────────── */
.er-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background: var(--primary, #0e6fad);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .8rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 10px rgba(14,111,173,.3);
    position: relative;
    overflow: hidden;
}
.er-submit-btn:hover { background: #0b5d94; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(14,111,173,.4); }
.er-submit-btn:active { transform: translateY(0); }
.er-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.er-submit-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: er-spin .65s linear infinite;
    flex-shrink: 0;
}
.er-submit-btn--loading .er-submit-icon { display: none; }
.er-submit-btn--loading .er-submit-spinner { display: inline-block; }

@keyframes er-spin { to { transform: rotate(360deg); } }

/* ── Sidebar ─────────────────────────────────────────────── */
.er-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.er-sidebar-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.er-sidebar-box--primary {
    background: linear-gradient(135deg, var(--primary, #0e6fad) 0%, #1d4ed8 100%);
    border: none;
    color: #fff;
}
.er-sidebar-box--primary .er-sidebar-box-head { color: #fff; border-bottom-color: rgba(255,255,255,.2); }
.er-sidebar-box--primary .er-sidebar-meta     { color: rgba(255,255,255,.85); }

.er-sidebar-box-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: .9rem;
}
.er-sidebar-box-head i  { font-size: 1rem; color: var(--primary, #0e6fad); }
.er-sidebar-box--primary .er-sidebar-box-head i { color: #fff; }
.er-sidebar-box-head h3 { font-size: .9rem; font-weight: 700; color: #1e293b; margin: 0; }
.er-sidebar-box--primary .er-sidebar-box-head h3 { color: #fff; }

.er-sidebar-event-name {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.45;
    margin: 0 0 .6rem;
}

.er-sidebar-meta {
    list-style: none;
    padding: 0; margin: 0;
    font-size: .83rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.er-sidebar-meta li { display: flex; align-items: center; gap: .5rem; }
.er-sidebar-meta i  { flex-shrink: 0; opacity: .8; }

.er-sidebar-loc-name {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 .35rem;
    line-height: 1.4;
}
.er-sidebar-loc-time {
    font-size: .82rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    min-height: 1.2em;
}

.er-sidebar-tips { border-color: #d1fae5; background: #f0fdf4; }
.er-tips-list {
    list-style: none;
    padding: 0; margin: 0;
    font-size: .82rem;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.er-tips-list li { display: flex; align-items: flex-start; gap: .5rem; line-height: 1.45; }
.er-tips-list li i { color: #16a34a; flex-shrink: 0; margin-top: 2px; }

.er-back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .86rem;
    color: #6b7280;
    text-decoration: none;
    padding: .5rem .75rem;
    border-radius: 8px;
    transition: color .18s, background .18s;
}
.er-back-link:hover { color: var(--primary, #0e6fad); background: #f0f7ff; }

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 600px) {
    .er-card { padding: 1.1rem 1rem; }
    .er-submit-btn { font-size: .93rem; padding: .75rem 1.25rem; }
    .er-sidebar { position: static; }
}

/* ── Province searchable picker ──────────────────────────── */
.er-province-picker {
    position: relative;
}
.er-province-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .92rem;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    user-select: none;
}
.er-province-display:focus,
.er-province-display[aria-expanded="true"] {
    border-color: var(--primary, #0e6fad);
    box-shadow: 0 0 0 3px rgba(14,111,173,.13);
}
.er-province-display-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}
.er-province-arrow {
    font-size: .75rem;
    color: #6b7280;
    flex-shrink: 0;
    transition: transform .2s;
}
.er-province-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 200;
    overflow: hidden;
}
.er-province-search-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
}
.er-province-search-wrap i { color: #9ca3af; flex-shrink: 0; font-size: .85rem; }
.er-province-search {
    border: none;
    outline: none;
    font-size: .88rem;
    color: #1e293b;
    width: 100%;
    background: transparent;
}
.er-province-list {
    list-style: none;
    padding: .35rem 0;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.er-province-opt {
    padding: .5rem .9rem;
    font-size: .88rem;
    color: #374151;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.er-province-opt:hover { background: #f0f7ff; color: var(--primary, #0e6fad); }
.er-province-opt--selected {
    background: #e0f2fe;
    color: var(--primary, #0e6fad);
    font-weight: 600;
}
@media (max-width: 480px) {
    .er-province-list { max-height: 180px; }
}
.er-input-wrap {
    position: relative;
}

.er-loading {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #1b74e4;
    font-size: 14px;
}