* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6fb;
    color: #111827;
}

.public-wrapper {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.rifa-hero {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 28px;
    align-items: stretch;
    margin-bottom: 24px;
}

.rifa-image {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    min-height: 360px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.rifa-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-image {
    height: 100%;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.rifa-info {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.tag {
    display: inline-flex;
    background: #dcfce7;
    color: #166534;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 16px;
}

.rifa-info h1 {
    font-size: 38px;
    margin-bottom: 16px;
}

.descripcion {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 24px;
}

.rifa-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.rifa-details div {
    background: #f9fafb;
    border-radius: 16px;
    padding: 18px;
}

.rifa-details strong {
    display: block;
    font-size: 22px;
    margin-bottom: 6px;
}

.rifa-details span {
    color: #6b7280;
    font-size: 14px;
}

.selection-panel {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.section-title {
    margin-bottom: 18px;
}

.section-title h2 {
    font-size: 28px;
    margin-bottom: 6px;
}

.section-title p {
    color: #6b7280;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    font-size: 14px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    display: inline-block;
}

.legend-box.disponible {
    background: #dcfce7;
}

.legend-box.seleccionado {
    background: #2563eb;
}

.legend-box.reservado {
    background: #fef3c7;
}

.legend-box.pagado {
    background: #fee2e2;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}

.number-btn {
    border: none;
    border-radius: 12px;
    height: 48px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.number-btn.disponible {
    background: #dcfce7;
    color: #166534;
}

.number-btn.disponible:hover {
    transform: translateY(-2px);
    background: #bbf7d0;
}

.number-btn.seleccionado {
    background: #2563eb !important;
    color: white !important;
}

.number-btn.reservado {
    background: #fef3c7;
    color: #92400e;
    cursor: not-allowed;
}

.number-btn.pagado {
    background: #fee2e2;
    color: #991b1b;
    cursor: not-allowed;
}

.customer-form {
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.customer-form h3 {
    margin-bottom: 18px;
}

.form-grid-public {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
}

.summary-box {
    background: #f9fafb;
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
}

.summary-box p {
    color: #6b7280;
    margin-bottom: 6px;
}

.summary-box strong {
    font-size: 20px;
}

.btn-whatsapp {
    width: 100%;
    border: none;
    background: #16a34a;
    color: white;
    font-size: 17px;
    font-weight: bold;
    padding: 16px;
    border-radius: 14px;
    cursor: pointer;
}

.btn-whatsapp:hover {
    background: #15803d;
}

.alert {
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .rifa-hero {
        grid-template-columns: 1fr;
    }

    .rifa-image {
        min-height: 280px;
    }

    .rifa-info h1 {
        font-size: 30px;
    }

    .rifa-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .public-wrapper {
        padding: 14px;
    }

    .rifa-info,
    .selection-panel {
        padding: 20px;
        border-radius: 18px;
    }

    .rifa-image {
        border-radius: 18px;
    }

    .rifa-info h1 {
        font-size: 26px;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .form-grid-public {
        grid-template-columns: 1fr;
    }

    .numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
        gap: 8px;
    }

    .number-btn {
        height: 42px;
        border-radius: 10px;
        font-size: 13px;
    }
}

.thanks-card {
    max-width: 620px;
    margin: 40px auto;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.thanks-card h1 {
    font-size: 34px;
    margin-bottom: 12px;
}

.thanks-card > p {
    color: #6b7280;
    margin-bottom: 20px;
}

.payment-box {
    background: #fef3c7;
    color: #92400e;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}

.payment-box h3 {
    margin-bottom: 8px;
}

.btn-secondary {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding: 15px;
    background: #111827;
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 600px) {
    .thanks-card {
        margin: 20px auto;
        padding: 22px;
        border-radius: 18px;
    }

    .thanks-card h1 {
        font-size: 28px;
    }
}

.countdown-box {
    background: #111827;
    color: white;
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 22px;
    text-align: center;
}

.countdown-box p {
    color: #d1d5db;
    margin-bottom: 8px;
}

.countdown-box strong {
    font-size: 28px;
    letter-spacing: 1px;
}

.disabled-form {
    opacity: 0.55;
    pointer-events: none;
}

.btn-whatsapp:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.rifa-details {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .rifa-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .rifa-details {
        grid-template-columns: 1fr;
    }

    .countdown-box {
        padding: 16px;
        border-radius: 16px;
    }

    .countdown-box strong {
        font-size: 22px;
        line-height: 1.4;
        word-break: break-word;
    }
}

.btn-link-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    line-height: 1.3;
    word-break: normal;
    white-space: normal;
}

@media (max-width: 480px) {
    .btn-link-whatsapp,
    .btn-secondary {
        width: 100%;
        font-size: 15px;
        padding: 14px 12px;
    }

    .summary-box strong {
        font-size: 18px;
        word-break: break-word;
    }
}

.rifa-info {
    position: relative;
}

.top-countdown {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 210px;
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #111827, #2563eb);
    color: white;
    text-align: center;
    box-shadow: 0 14px 35px rgba(0,0,0,0.18);
}

.top-countdown p {
    margin-bottom: 6px;
    color: #dbeafe;
    font-size: 14px;
    font-weight: bold;
}

.top-countdown strong {
    display: block;
    font-size: 25px;
    line-height: 1.25;
}

.rifa-info .tag {
    margin-right: 230px;
}

@media (max-width: 900px) {
    .top-countdown {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-bottom: 18px;
    }

    .rifa-info .tag {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .top-countdown {
        padding: 16px;
    }

    .top-countdown strong {
        font-size: 22px;
    }
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
}

.form-group input[type="file"] {
    background: #f9fafb;
    cursor: pointer;
}

@media (max-width: 480px) {
    .form-group input[type="file"] {
        font-size: 14px;
        padding: 12px;
    }
}

.tag-finalizada {
    background: #fee2e2;
    color: #991b1b;
}

.public-winner-box {
    margin-top: 24px;
    background: linear-gradient(135deg, #111827, #7c3aed);
    color: white;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
}

.public-winner-box p {
    color: #ddd6fe;
    margin-bottom: 8px;
    font-weight: bold;
}

.public-winner-box strong {
    display: block;
    font-size: 54px;
    line-height: 1;
    margin-bottom: 10px;
}

.public-winner-box span {
    display: block;
    font-size: 18px;
}

@media (max-width: 600px) {
    .public-winner-box {
        padding: 20px;
        border-radius: 16px;
    }

    .public-winner-box strong {
        font-size: 42px;
    }
}

.home-hero {
    min-height: 520px;
    background: radial-gradient(circle at top left, #2563eb, #111827 55%);
    color: white;
    padding: 60px 24px;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 28px;
    align-items: center;
}

.home-hero-content {
    max-width: 760px;
}

.home-tag {
    display: inline-flex;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: bold;
    margin-bottom: 18px;
}

.home-hero h1 {
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.05;
    margin-bottom: 18px;
}

.home-hero p {
    font-size: 18px;
    color: #dbeafe;
    line-height: 1.6;
    max-width: 620px;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.btn-home-primary,
.btn-home-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-radius: 14px;
    font-weight: bold;
    text-decoration: none;
}

.btn-home-primary {
    background: white;
    color: #111827;
}

.btn-home-secondary {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
}

.home-stats {
    display: grid;
    gap: 16px;
}

.home-stats div {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    padding: 24px;
}

.home-stats strong {
    display: block;
    font-size: 42px;
    margin-bottom: 6px;
}

.home-stats span {
    color: #dbeafe;
}

.home-wrapper {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 40px 24px;
}

.home-section {
    margin-bottom: 54px;
}

.home-section-title {
    margin-bottom: 24px;
}

.home-section-title h2 {
    font-size: 34px;
    margin-bottom: 8px;
}

.home-section-title p {
    color: #6b7280;
}

.home-rifas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.home-rifa-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.home-rifa-image {
    height: 230px;
    background: #f3f4f6;
}

.home-rifa-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-rifa-body {
    padding: 22px;
}

.home-status {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
}

.home-status.active {
    background: #dcfce7;
    color: #166534;
}

.home-rifa-body h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.home-rifa-body p {
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 18px;
}

.home-rifa-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.home-rifa-info div {
    background: #f9fafb;
    border-radius: 14px;
    padding: 14px;
}

.home-rifa-info strong,
.home-rifa-info span {
    display: block;
}

.home-rifa-info span {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.home-progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.home-progress div {
    height: 100%;
    background: linear-gradient(135deg, #16a34a, #2563eb);
}

.btn-card {
    display: flex;
    justify-content: center;
    background: #2563eb;
    color: white;
    padding: 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
}

.home-empty {
    background: white;
    border-radius: 22px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
}

.home-empty h3 {
    margin-bottom: 8px;
}

.home-empty p {
    color: #6b7280;
}

.winners-public-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.winner-public-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.winner-public-number {
    width: 86px;
    height: 86px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #111827, #7c3aed);
    color: white;
    font-size: 26px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-public-card h3 {
    margin-bottom: 10px;
}

.winner-public-card p {
    color: #6b7280;
    margin-bottom: 8px;
}

.winner-public-card span {
    display: block;
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-winner {
    display: flex;
    justify-content: center;
    background: #111827;
    color: white;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 1000px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .home-rifas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .winners-public-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .home-hero {
        padding: 42px 16px;
        min-height: auto;
    }

    .home-actions a {
        width: 100%;
    }

    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-wrapper {
        padding: 30px 14px;
    }

    .home-rifas-grid,
    .winners-public-grid {
        grid-template-columns: 1fr;
    }

    .home-section-title h2 {
        font-size: 28px;
    }

    .home-rifa-image {
        height: 210px;
    }
}

.rifa-info {
    padding-top: 32px;
}

.rifa-info h1 {
    padding-right: 240px;
}

@media (max-width: 900px) {
    .rifa-info h1 {
        padding-right: 0;
    }
}

.back-home-btn {
    display: inline-flex;
    margin-bottom: 14px;
    color: #2563eb;
    font-weight: bold;
    text-decoration: none;
}

.back-home-btn:hover {
    text-decoration: underline;
}

.home-hero-image {
    position: relative;
    min-height: 560px;
    background-image:
        linear-gradient(135deg, rgba(17,24,39,0.88), rgba(37,99,235,0.65)),
        url('../img/rifas-bg.png');
    background-size: cover;
    background-position: center;
    grid-template-columns: 1fr;
}

.home-hero-overlay {
    display: none;
}

.home-hero-image .home-hero-content {
    position: relative;
    z-index: 2;
}

.home-rifa-image {
    position: relative;
}

.card-countdown {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: rgba(17, 24, 39, 0.88);
    color: white;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.card-countdown span {
    display: block;
    color: #dbeafe;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.card-countdown strong {
    display: block;
    font-size: 18px;
}

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.pagination a {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: white;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

.pagination a.active,
.pagination a:hover {
    background: #2563eb;
    color: white;
}

@media (max-width: 640px) {
    .home-hero-image {
        min-height: 480px;
    }

    .card-countdown strong {
        font-size: 16px;
    }
}

.upload-payment-box {
    background: #f9fafb;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.upload-payment-box h3 {
    margin-bottom: 8px;
}

.upload-payment-box p {
    color: #6b7280;
    margin-bottom: 14px;
}

.upload-form {
    display: grid;
    gap: 12px;
}

.upload-form input[type="file"] {
    width: 100%;
    background: white;
    border: 1px solid #d1d5db;
    padding: 13px;
    border-radius: 12px;
}

.success-text {
    color: #166534 !important;
    font-weight: bold;
}

.upload-payment-box {
    margin-top: 22px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
}

.upload-payment-box h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.upload-payment-box p {
    color: #6b7280;
    margin-bottom: 14px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upload-form input[type="file"] {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
}

.upload-form .btn-whatsapp {
    margin-top: 0;
}

.thanks-card .btn-whatsapp,
.thanks-card .btn-secondary {
    margin-top: 12px;
}

@media (max-width: 480px) {
    .upload-payment-box {
        padding: 16px;
    }

    .upload-payment-box h3 {
        font-size: 20px;
    }

    .upload-form input[type="file"] {
        font-size: 14px;
        padding: 12px;
    }
}

.upload-payment-box .btn-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.upload-payment-box .upload-form {
    margin-top: 18px;
}

.payment-public-card{
    margin-top:30px;
    padding:24px;
    border-radius:28px;
    overflow:hidden;
    position:relative;

    background:
    linear-gradient(
    135deg,
    #0f172a,
    #1e3a8a,
    #2563eb
    );

    color:white;

    box-shadow:
    0 20px 50px rgba(37,99,235,.25);

}

.payment-public-card::before{
    content:'';
    position:absolute;

    width:220px;
    height:220px;

    top:-90px;
    right:-70px;

    border-radius:50%;

    background:
    rgba(255,255,255,.08);
}

.payment-public-card{
    margin-top:22px;

    width:100%;
    max-width:420px;

    padding:18px;

    border-radius:22px;
    overflow:hidden;
    position:relative;

    background:
    linear-gradient(
    135deg,
    #0f172a,
    #1e3a8a,
    #2563eb
    );

    color:white;

    box-shadow:
    0 12px 25px rgba(37,99,235,.18);

}

.payment-public-card::before{
    content:'';
    position:absolute;

    width:120px;
    height:120px;

    top:-45px;
    right:-30px;

    border-radius:50%;
    background:rgba(255,255,255,.08);
}

.payment-public-card::after{
    content:'';
    position:absolute;

    width:90px;
    height:90px;

    bottom:-35px;
    left:-20px;

    border-radius:50%;
    background:rgba(255,255,255,.05);
}

.payment-card-top{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:18px;

    position:relative;
    z-index:2;
}

.payment-card-top span{
    font-size:10px;
    opacity:.75;
    text-transform:uppercase;
}

.payment-card-top h3{
    margin-top:2px;
    font-size:16px;
}

.payment-chip{

    width:42px;
    height:30px;

    border-radius:8px;

    background:
    linear-gradient(
    135deg,
    #fbbf24,
    #fde68a
    );
}

.payment-card-number{

    position:relative;
    z-index:2;

    font-size:14px;
    line-height:1.6;
    font-weight:600;

    margin-bottom:18px;

    white-space:pre-line;
}

.payment-card-bottom{

    display:flex;
    justify-content:space-between;
    align-items:center;

    position:relative;
    z-index:2;
}

.payment-card-bottom small{
    display:block;
    font-size:10px;
    opacity:.7;
}

.payment-card-bottom strong{
    font-size:12px;
}

.payment-brand{
    font-size:22px;
    letter-spacing:-4px;
}

@media(max-width:768px){

.payment-public-card{

max-width:100%;

}

}

.verify-panel {
    margin-top: 24px;
}

.verify-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
}

.verify-form .btn-secondary {
    border: none;
    cursor: pointer;
}

.verify-results-card {
    max-width: 760px;
}

.verify-reserva-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
}

@media (max-width: 700px) {
    .verify-form {
        grid-template-columns: 1fr;
    }

    .payment-public-card {
        margin-top: 16px;
    }
}

.thanks-payment-card {
    max-width: 100%;
    margin-bottom: 22px;
}

.btn-disabled-whatsapp {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.85;
}

.btn-disabled-whatsapp:hover {
    background: #9ca3af !important;
}

