/* ===== Gaby Rifa — Frontend Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');

.rifa-container {
    font-family: 'Nunito', sans-serif;
    max-width: 520px;
    margin: 24px auto;
    padding: 0 16px;
}

.rifa-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(107,57,196,.18), 0 2px 8px rgba(0,0,0,.06);
    padding: 36px 32px 32px;
    position: relative;
    overflow: hidden;
}

.rifa-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #ec4899, #f59e0b);
    border-radius: 24px 24px 0 0;
}

/* ─── Header ─── */
.rifa-header { text-align: center; margin-bottom: 28px; }

.rifa-ticket-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
    display: block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.rifa-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #4c1d95;
    margin: 0 0 8px;
    line-height: 1.2;
}

.rifa-date {
    font-size: 14px;
    color: #7c3aed;
    margin: 0 0 10px;
    font-weight: 600;
}

.rifa-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.rifa-subtitle strong { color: #7c3aed; }

/* ─── Form fields ─── */
.rifa-field {
    margin-bottom: 18px;
}

.rifa-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.rifa-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    color: #111827;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    background: #fafafa;
}

.rifa-field input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
    background: #fff;
}

.rifa-field input.rifa-input-error {
    border-color: #ef4444;
}

.rifa-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    display: block;
}

/* ─── Error ─── */
.rifa-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ─── Buttons ─── */
.rifa-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    box-shadow: 0 4px 15px rgba(124,58,237,.4);
    letter-spacing: .3px;
    margin-top: 8px;
}

.rifa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,.5);
}

.rifa-btn:active { transform: translateY(0); }

.rifa-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.rifa-btn-secondary {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 15px rgba(5,150,105,.35);
    margin-top: 20px;
}

.rifa-btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(5,150,105,.45);
}

/* ─── Facebook pages ─── */
.rifa-pages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.rifa-page-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: #1877f2;
    color: #fff;
    border-radius: 14px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: background .2s, transform .15s;
    box-shadow: 0 3px 12px rgba(24,119,242,.35);
}

.rifa-page-btn:hover {
    background: #0d65d8;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.fb-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 900;
    flex-shrink: 0;
    line-height: 32px;
    text-align: center;
}

/* ─── Instructions ─── */
.rifa-instructions {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13.5px;
    color: #78350f;
    line-height: 1.6;
    margin: 16px 0 0;
}

.rifa-instructions strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

/* ─── Numbers display ─── */
.rifa-numbers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.rifa-number-badge {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(124,58,237,.35);
    letter-spacing: 2px;
    animation: popIn .4s ease backwards;
}

@keyframes popIn {
    from { transform: scale(.5); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

/* stagger badges */
.rifa-number-badge:nth-child(1) { animation-delay: .0s; }
.rifa-number-badge:nth-child(2) { animation-delay: .1s; }
.rifa-number-badge:nth-child(3) { animation-delay: .2s; }
.rifa-number-badge:nth-child(4) { animation-delay: .3s; }
.rifa-number-badge:nth-child(5) { animation-delay: .4s; }

/* ─── Success message ─── */
.rifa-success-msg {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #166534;
    line-height: 1.6;
}

.rifa-success-msg p { margin: 0 0 6px; }
.rifa-success-msg p:last-child { margin-bottom: 0; }

/* ─── Closed state ─── */
.rifa-closed {
    text-align: center;
    font-size: 16px;
    color: #6b7280;
    padding: 20px 0;
}

.rifa-inactive .rifa-card::before {
    background: #9ca3af;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
    .rifa-card { padding: 28px 20px 24px; }
    .rifa-title { font-size: 22px; }
    .rifa-number-badge { font-size: 22px; padding: 10px 16px; }
}

/* ─── Registro info + sorteo code ─────────────────────────────── */
.rifa-registro-info {
    text-align: center;
    margin: 6px 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    line-height: 1.8;
}
.rifa-reg-date {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}
.rifa-sorteo-code {
    text-align: center;
    font-family: monospace;
    font-size: 11px;
    color: #9ca3af;
    letter-spacing: 0.8px;
    margin: 2px 0 12px;
}

/* ─── Buscar widget ──────────────────────────────────────────── */
.rifa-buscar-wrap {
    font-family: 'Nunito', sans-serif;
    max-width: 520px;
    margin: 24px auto;
    padding: 0 16px;
}
.rifa-buscar-inner {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(107,57,196,.18), 0 2px 8px rgba(0,0,0,.06);
    padding: 36px 32px 32px;
    position: relative;
    overflow: hidden;
}
.rifa-buscar-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #ec4899, #f59e0b);
    border-radius: 24px 24px 0 0;
}
.rifa-buscar-found {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 16px;
    padding: 22px 20px 18px;
    margin-top: 16px;
    text-align: center;
}
.rifa-buscar-hint {
    font-size: 12.5px;
    color: #166534;
    margin-top: 12px;
}
.rifa-buscar-notfound {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: 14px;
    padding: 16px;
    margin-top: 14px;
    font-size: 14px;
    color: #dc2626;
    font-weight: 600;
    text-align: center;
}

/* ─── Progress bar ──────────────────────────────────────────── */
.rifa-progress {
    margin: 0 0 24px;
    padding: 0 4px;
}

.rifa-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Step circle + label */
.rifa-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    position: relative;
    z-index: 1;
}

.rifa-progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 2.5px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .35s, border-color .35s, transform .25s;
    position: relative;
    overflow: hidden;
}

.rifa-progress-num {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #9ca3af;
    transition: opacity .2s;
    position: absolute;
}

.rifa-progress-check {
    width: 14px;
    height: 12px;
    opacity: 0;
    transition: opacity .2s .1s;
    position: absolute;
}

.rifa-progress-label {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    white-space: nowrap;
    transition: color .35s;
    letter-spacing: .2px;
}

/* Connector line */
.rifa-progress-line {
    flex: 1;
    height: 3px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 0 8px;
    margin-bottom: 22px; /* align with dot center */
    overflow: hidden;
    position: relative;
}

.rifa-progress-line-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    border-radius: 3px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* Active step */
.rifa-progress-step.active .rifa-progress-dot {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-color: #7c3aed;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(124,58,237,.18);
}
.rifa-progress-step.active .rifa-progress-num { color: #fff; }
.rifa-progress-step.active .rifa-progress-label { color: #7c3aed; font-weight: 800; }

/* Completed step */
.rifa-progress-step.done .rifa-progress-dot {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #059669;
    transform: scale(1);
    box-shadow: none;
}
.rifa-progress-step.done .rifa-progress-num { opacity: 0; }
.rifa-progress-step.done .rifa-progress-check { opacity: 1; }
.rifa-progress-step.done .rifa-progress-label { color: #059669; }

/* ─── Availability bar ──────────────────────────────────────── */
.rifa-avail-bar-wrap {
    margin: 0 0 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
}
.rifa-avail-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.rifa-avail-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}
.rifa-avail-count {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    font-family: monospace;
}
.rifa-avail-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}
.rifa-avail-fill {
    height: 100%;
    border-radius: 10px;
    transition: width .6s ease;
}
.rifa-avail-foot {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
}

/* ─── Numbers grid (5 columns, smaller) ─────────────────────── */
.rifa-numbers-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
    margin: 16px 0 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.rifa-numbers-grid .rifa-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    padding: 8px 4px;
    border-radius: 10px;
    letter-spacing: 1px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    overflow: hidden;
}
