/* ── Overlay ── */
.em-reg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    animation: emRegFadeIn 0.2s ease;
}
.em-reg-overlay[hidden] { display: none !important; }

@keyframes emRegFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal box ── */
.em-reg-modal {
    background: #fff;
    border-radius: 20px;
    padding: 36px 40px 40px;
    max-width: 560px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    animation: emRegSlideUp 0.22s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes emRegSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close button ── */
.em-reg-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.em-reg-close:hover { background: #e2e8f0; color: #1e293b; }

/* ── Header ── */
.em-reg-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.em-reg-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    flex-shrink: 0;
}
.em-reg-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 2px;
    line-height: 1.2;
}
.em-reg-event-name {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* ── Form ── */
.em-reg-row { display: flex; gap: 16px; }
.em-reg-row-2 > .em-reg-field { flex: 1; }

.em-reg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}
.em-reg-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}
.em-req { color: #ef4444; }

.em-reg-field input,
.em-reg-field textarea {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.93rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.em-reg-field input:focus,
.em-reg-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.em-reg-field input.em-invalid,
.em-reg-field textarea.em-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.em-reg-field textarea { resize: vertical; min-height: 80px; }

/* ── Error alert ── */
.em-reg-alert {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.em-reg-alert[hidden] { display: none !important; }
.em-reg-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Submit button ── */
.em-reg-submit {
    width: 100%;
    padding: 13px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}
.em-reg-submit:hover { background: #1d4ed8; }
.em-reg-submit:active { transform: scale(0.98); }
.em-reg-submit:disabled { background: #93c5fd; cursor: not-allowed; }
.em-reg-submit-loading[hidden] { display: none !important; }

@keyframes emRegSpin {
    to { transform: rotate(360deg); }
}
.em-reg-spinner { animation: emRegSpin 0.8s linear infinite; }

/* ── Success state ── */
.em-reg-success {
    text-align: center;
    padding: 20px 0 10px;
}
.em-reg-success[hidden] { display: none !important; }
.em-reg-success svg { margin-bottom: 16px; }
.em-reg-success h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px;
}
.em-reg-success p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 24px;
    line-height: 1.5;
}
.em-reg-close-success {
    padding: 10px 28px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s;
}
.em-reg-close-success:hover { background: #e2e8f0; }

/* ── Responsive ── */
@media (max-width: 520px) {
    .em-reg-modal { padding: 28px 20px 30px; }
    .em-reg-row-2 { flex-direction: column; gap: 0; }
}
