﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f7f4fb;
    --card: #ffffff;
    --primary: #872F98;
    --primary-2: #872F98;
    --accent: #ffb900;
    --accent-2: #ffb900;
    --danger-brand: #E21B1B;
    --text: #1f1630;
    --muted: #6b7280;
    --border: #eadff1;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #2563eb;
    --shadow: 0 18px 40px rgba(66, 18, 84, 0.10);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    background: radial-gradient(circle at top left, rgba(226, 27, 27, 0.08), transparent 25%), radial-gradient(circle at top right, rgba(135, 47, 152, 0.10), transparent 30%), var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 28px;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

    .brand-logo img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px 0;
    line-height: 1.15;
}

.brand-text p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.hero {
    background: linear-gradient(135deg, var(--danger-brand), var(--primary) 55%, var(--primary-2));
    color: white;
    border-radius: 30px;
    padding: 42px;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    overflow: hidden;
    position: relative;
}

    .hero::after {
        content: "";
        position: absolute;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        right: -80px;
        top: -80px;
        background: rgba(255,255,255,0.08);
    }

    .hero::before {
        content: "";
        position: absolute;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        left: 55%;
        bottom: -130px;
        background: rgba(255,255,255,0.06);
    }

.hero-left,
.hero-card {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    margin-bottom: 16px;
}

.hero h2 {
    font-size: 42px;
    line-height: 1.08;
    margin-bottom: 14px;
    max-width: 650px;
    font-weight: 700;
}

.hero p {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.88);
    max-width: 650px;
}

.hero-features {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-feature {
    background: rgba(255,255,255,0.10);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.12);
}

.hero-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 24px;
    align-self: center;
}

    .hero-card h3 {
        font-size: 18px;
        margin-bottom: 16px;
        font-weight: 700;
    }

.search-box {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

    .search-box input {
        flex: 1;
        min-width: 220px;
        border: none;
        outline: none;
        padding: 16px 18px;
        border-radius: 16px;
        font-size: 15px;
        color: var(--text);
    }

.btn-primary,
.btn-secondary,
.cta {
    border: none;
    outline: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    border-radius: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #4a1d00;
    padding: 16px 22px;
}

    .btn-primary:hover,
    .cta:hover,
    .btn-secondary:hover {
        transform: translateY(-2px);
    }

.mini-note {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.84);
    line-height: 1.5;
}

.main-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.95fr;
    gap: 26px;
    align-items: start;
    scroll-margin-top: 24px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(234, 223, 241, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.section {
    padding: 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.section-title h3 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.2;
}

.section-title p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
}

.status-pill {
    background: #ecfdf3;
    color: var(--success);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #d1fae5;
}

.account-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.summary-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fcf8ff);
}

    .summary-box span {
        display: block;
        color: var(--muted);
        font-size: 13px;
        margin-bottom: 10px;
        font-weight: 400;
    }

    .summary-box strong {
        display: block;
        font-size: 18px;
        color: var(--text);
        font-weight: 600;
        line-height: 1.2;
    }

    .summary-box small {
        display: block;
        margin-top: 8px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
    }

.bill-list {
    display: grid;
    gap: 16px;
}

.bill-item {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    transition: 0.25s ease;
    cursor: pointer;
    background: white;
}

    .bill-item:hover {
        border-color: rgba(135, 47, 152, 0.25);
        box-shadow: 0 10px 24px rgba(135, 47, 152, 0.10);
        transform: translateY(-2px);
    }

    .bill-item.active {
        border: 2px solid var(--danger-brand);
        background: #fff6f6;
    }

.bill-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--danger-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: white;
    background: var(--danger-brand);
    flex-shrink: 0;
}

    .bill-check.off {
        background: white;
        color: transparent;
        border-color: #cdbfd8;
    }

.bill-info h4 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
    line-height: 1.25;
}

.bill-info p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
}

.bill-tags {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #faf5ff;
    color: var(--primary);
    border: 1px solid #eadff1;
    font-weight: 500;
}

.bill-amount {
    text-align: right;
}

    .bill-amount .amount {
        font-size: 20px;
        color: var(--primary);
        font-weight: 600;
        line-height: 1.1;
        margin-bottom: 6px;
    }

    .bill-amount .due {
        color: #9a3412;
        font-size: 13px;
        background: #fff7ed;
        padding: 8px 10px;
        border-radius: 999px;
        border: 1px solid #fed7aa;
        display: inline-block;
        font-weight: 500;
    }

.sidebar {
    position: sticky;
    top: 24px;
}

.payment-card {
    padding: 26px;
}

.payment-top {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

    .payment-top span {
        display: block;
        color: var(--muted);
        font-size: 13px;
        margin-bottom: 8px;
        font-weight: 400;
    }

    .payment-top h3 {
        font-size: 32px;
        color: var(--primary);
        font-weight: 700;
        line-height: 1.1;
    }

.payment-detail {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
    color: var(--text);
}

    .payment-row.muted {
        color: var(--muted);
    }

    .payment-row.total {
        margin-top: 8px;
        padding-top: 16px;
        border-top: 1px dashed var(--border);
        font-size: 19px;
        font-weight: 700;
        color: var(--primary);
    }

.fake-form {
    margin-top: 18px;
    display: grid;
    gap: 14px;
    width: 100%;
}

#cardInfo .input-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

    #cardInfo .input-group label {
        display: block !important;
        font-size: 13px !important;
        color: var(--muted) !important;
        font-weight: 700 !important;
        margin: 0 !important;
        line-height: 1.35 !important;
    }

    #cardInfo .input-group input,
    #cardInfo .input-group select {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 54px !important;
        padding: 0 16px !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        outline: none !important;
        transition: 0.2s ease !important;
        box-sizing: border-box !important;
        background: #fff !important;
        color: var(--text) !important;
        margin: 0 !important;
        box-shadow: none !important;
        -webkit-appearance: none;
        appearance: none;
    }

        #cardInfo .input-group input:focus,
        #cardInfo .input-group select:focus {
            border-color: var(--primary) !important;
            box-shadow: 0 0 0 4px rgba(135, 47, 152, 0.12) !important;
        }

        #cardInfo .input-group input::placeholder {
            color: #8b8f98;
            opacity: 1;
        }

.row-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
}

    .row-2 > * {
        min-width: 0;
    }

.security-box {
    margin-top: 18px;
    border: 1px solid #ffb900;
    background: #fff8e6;
    padding: 16px;
    border-radius: 16px;
    color: #7a5600;
    font-size: 13px;
    line-height: 1.6;
}

.cta {
    width: 100%;
    background: linear-gradient(135deg, var(--danger-brand), var(--primary));
    color: white;
    padding: 18px 20px;
    font-size: 16px;
    box-shadow: 0 14px 24px rgba(135, 47, 152, 0.22);
    margin-top: 20px;
}

.btn-secondary {
    width: 100%;
    background: #fff8e6;
    color: var(--primary);
    padding: 16px 18px;
    margin-top: 12px;
    border: 1px solid #ffb900;
}

.footer-note {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    width: 100%;
}

.accepted-cards-footer {
    width: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .accepted-cards-footer .accepted-cards-list {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .accepted-cards-footer .accepted-card-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        padding: 0;
        border: none;
        background: transparent;
    }

        .accepted-cards-footer .accepted-card-item img {
            height: 18px;
            width: auto;
            object-fit: contain;
            display: block;
        }

.terms-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.check-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 13px;
    line-height: 1.45;
}

.hidden {
    display: none !important;
}

#load_screen {
    position: fixed;
    inset: 0;
    background: rgba(31,22,48,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loader-box {
    background: rgba(255,255,255,0.92);
    padding: 20px 24px;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(31, 22, 48, 0.18);
    color: var(--primary);
    font-weight: 700;
    min-width: 220px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.6);
}

.loader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid rgba(135, 47, 152, 0.15);
    border-top-color: var(--danger-brand);
    margin: 0 auto 14px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.alert-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 420px;
    width: calc(100% - 32px);
}

.alert-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px 16px 18px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    animation: alertIn .28s ease;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-card.closing {
    animation: alertOut .22s ease forwards;
}

@keyframes alertOut {
    to {
        opacity: 0;
        transform: translateX(18px) scale(.98);
    }
}

.alert-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    min-width: 0;
}

.alert-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.alert-message {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    word-wrap: break-word;
}

.alert-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    margin-top: 2px;
    border-radius: 10px;
    transition: .2s ease;
}

    .alert-close:hover {
        background: #f1f5f9;
        color: #334155;
    }

.alert-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    transform-origin: left center;
    animation: progressShrink linear forwards;
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.alert-success .alert-icon {
    background: #ecfdf3;
    color: var(--success);
}

.alert-success .alert-progress {
    background: var(--success);
}

.alert-error .alert-icon {
    background: #fef2f2;
    color: var(--danger);
}

.alert-error .alert-progress {
    background: var(--danger);
}

.alert-info .alert-icon {
    background: #eff6ff;
    color: var(--info);
}

.alert-info .alert-progress {
    background: var(--info);
}

.alert-warning .alert-icon {
    background: #fffbeb;
    color: var(--warning);
}

.alert-warning .alert-progress {
    background: var(--warning);
}

@media (max-width: 1100px) {
    .hero,
    .main-grid {
        grid-template-columns: 1fr;
    }

    .account-summary,
    .benefits {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    html,
    body {
        overflow-x: hidden;
    }

    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    .topbar {
        margin-bottom: 10px;
        gap: 10px;
    }

    .brand {
        gap: 10px;
        align-items: center;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .brand-text h1 {
        font-size: 18px;
        line-height: 1.15;
        margin: 0 0 2px 0;
    }

    .brand-text p {
        font-size: 12px;
        line-height: 1.35;
        margin: 0;
    }

    .hero {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 24px 14px 22px;
        border-radius: 22px;
        margin-bottom: 12px;
        min-height: calc(100svh - 90px);
    }

    .hero-left {
        order: 1;
        padding-top: 4px;
    }

    .hero-card {
        order: 2;
        width: 100%;
        max-width: none;
        margin-top: 10px;
        padding: 16px;
        border-radius: 18px;
        align-self: stretch;
    }

        .hero-card h3 {
            font-size: 16px;
            margin-bottom: 10px;
        }

    .eyebrow {
        padding: 6px 10px;
        font-size: 11px;
        margin-bottom: 14px;
    }

    .hero h2 {
        font-size: 24px;
        line-height: 1.12;
        margin-bottom: 12px;
        max-width: none;
    }

    .hero p {
        font-size: 14px;
        line-height: 1.45;
        max-width: none;
        margin-bottom: 0;
    }

    .hero-features {
        display: none;
    }

    .terms-grid {
        margin-top: 14px;
        gap: 10px;
    }

    .check-row {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 12px;
        font-size: 12px;
        line-height: 1.35;
    }

        .check-row input {
            margin-top: 2px;
            transform: scale(0.95);
        }

    .search-box {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 10px;
    }

        .search-box input {
            width: 100%;
            min-width: 0;
            padding: 14px 16px;
            font-size: 14px;
            border-radius: 14px;
        }

    .btn-primary {
        width: 100%;
        padding: 14px 18px;
        border-radius: 14px;
    }

    .mini-note {
        display: none;
    }

    .section,
    .payment-card,
    .extra-section {
        padding: 18px;
    }

    .account-summary,
    .benefits,
    .row-2 {
        grid-template-columns: 1fr;
    }

    .bill-item {
        grid-template-columns: 1fr;
    }

    .bill-amount {
        text-align: left;
    }

    .alert-stack {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
        max-width: none;
    }
}


/* ============================
   NUEVO: selector de modo
============================ */
.payment-mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mode-pill {
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.12);
    color: white;
    padding: 12px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.25s ease;
    min-width: 150px;
    text-align: center;
}

    .mode-pill:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,0.18);
    }

    .mode-pill.active {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: #4a1d00;
        border-color: transparent;
        box-shadow: 0 10px 24px rgba(255, 185, 0, 0.22);
    }

/* ============================
   NUEVO: cajas vacías / notas
============================ */
.empty-state-box {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--muted);
    background: #fff;
}

.phone-topup-note {
    margin-bottom: 16px;
    border: 1px solid #ffe7a0;
    background: #fffaf0;
    color: #7a5600;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.payment-mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mode-pill {
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.12);
    color: white;
    padding: 12px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.25s ease;
    min-width: 150px;
    text-align: center;
}

    .mode-pill:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,0.18);
    }

    .mode-pill.active {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: #4a1d00;
        border-color: transparent;
        box-shadow: 0 10px 24px rgba(255, 185, 0, 0.22);
    }

.empty-state-box {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--muted);
    background: #fff;
}

.phone-topup-note {
    margin-bottom: 16px;
    border: 1px solid #ffe7a0;
    background: #fffaf0;
    color: #7a5600;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.phone-line-list {
    display: grid;
    gap: 16px;
}

.phone-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    background: white;
    transition: 0.25s ease;
}

    .phone-card:hover {
        border-color: rgba(135, 47, 152, 0.25);
        box-shadow: 0 10px 24px rgba(135, 47, 152, 0.10);
        transform: translateY(-2px);
    }

    .phone-card.active {
        border: 2px solid var(--primary);
        background: #fcf7ff;
    }

.phone-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

    .phone-card-top h4 {
        font-size: 18px;
        color: var(--text);
        margin-bottom: 4px;
        font-weight: 700;
    }

    .phone-card-top p {
        font-size: 13px;
        color: var(--muted);
        line-height: 1.45;
    }

.phone-badge {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #d1fae5;
    white-space: nowrap;
}

.phone-amount-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.amount-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
    min-width: 95px;
}

    .amount-chip:hover {
        border-color: var(--primary);
        box-shadow: 0 8px 18px rgba(135, 47, 152, 0.10);
        transform: translateY(-1px);
    }

    .amount-chip.active {
        background: linear-gradient(135deg, var(--danger-brand), var(--primary));
        color: white;
        border-color: transparent;
        box-shadow: 0 12px 22px rgba(135, 47, 152, 0.18);
    }

.section-header-inline {
    margin-top: 4px;
    margin-bottom: 16px;
}

#phoneTopupPanel.hidden,
#billingPanel.hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .payment-mode-switch {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mode-pill {
        width: 100%;
        min-width: 0;
    }

    .phone-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .phone-amount-grid {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .amount-chip {
        width: 100%;
        min-width: 0;
    }
}




/* =========================================================
   MODAL DE RESULTADO DE TRANSACCIÓN
   Reemplaza el bloque anterior por este
========================================================= */

.transaction-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(31, 22, 48, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: transactionFadeIn 0.25s ease;
}

.transaction-modal-card {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: linear-gradient(180deg, #ffffff 0%, #fcf8ff 100%);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(66, 18, 84, 0.22);
    border: 1px solid var(--border);
    padding: 34px 30px 28px;
    text-align: center;
    animation: transactionScaleIn 0.25s ease;
    overflow: hidden;
}

    .transaction-modal-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 6px;
        background: linear-gradient(135deg, var(--danger-brand), var(--primary), var(--accent));
    }

.transaction-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .transaction-modal-close:hover {
        transform: scale(1.05);
        background: #faf5ff;
        border-color: rgba(135, 47, 152, 0.25);
    }

.transaction-modal-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    box-shadow: inset 0 0 0 8px rgba(255,255,255,0.20), 0 14px 30px rgba(66, 18, 84, 0.18);
}

    .transaction-modal-icon.success {
        background: linear-gradient(135deg, var(--success), #0f8a3d);
    }

    .transaction-modal-icon.error {
        background: linear-gradient(135deg, var(--danger-brand), var(--danger));
    }

    .transaction-modal-icon.info {
        background: linear-gradient(135deg, var(--primary), var(--primary-2));
    }

    .transaction-modal-icon.warning {
        background: linear-gradient(135deg, var(--accent), #d99c00);
        color: #4a1d00;
        box-shadow: inset 0 0 0 8px rgba(255,255,255,0.28), 0 14px 30px rgba(255, 185, 0, 0.22);
    }

.transaction-modal-eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}

.transaction-modal-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    color: var(--text);
    font-weight: 800;
}

.transaction-modal-message {
    margin: 14px auto 0;
    max-width: 460px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--muted);
}

.transaction-modal-actions {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}

.transaction-modal-btn {
    min-width: 190px;
    border: none;
    border-radius: 16px;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--danger-brand), var(--primary));
    box-shadow: 0 14px 24px rgba(135, 47, 152, 0.22);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .transaction-modal-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 30px rgba(135, 47, 152, 0.26);
    }

    .transaction-modal-btn:active {
        transform: translateY(0);
    }

body.transaction-modal-open {
    overflow: hidden;
}

@keyframes transactionFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes transactionScaleIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 576px) {
    .transaction-modal-backdrop {
        padding: 16px;
    }

    .transaction-modal-card {
        padding: 28px 20px 22px;
        border-radius: 22px;
    }

    .transaction-modal-title {
        font-size: 24px;
    }

    .transaction-modal-message {
        font-size: 15px;
    }

    .transaction-modal-icon {
        width: 84px;
        height: 84px;
        font-size: 36px;
    }

    .transaction-modal-btn {
        width: 100%;
    }
}





/* =========================================
   FIX IPHONE / MOBILE INPUT + ALERTAS
========================================= */

html {
    -webkit-text-size-adjust: 100%;
}

input,
select,
textarea,
button {
    font: inherit;
}

@media (max-width: 760px) {
    .search-box {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        width: 100%;
    }

        .search-box input,
        .search-box .btn-primary,
        .search-box button {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
        }

        .search-box input {
            display: block;
            box-sizing: border-box;
            -webkit-appearance: none;
            appearance: none;
            border: none;
            outline: none;
            min-height: 54px;
            height: 54px;
            padding: 0 16px;
            font-size: 16px !important;
            line-height: 1.2;
            border-radius: 14px;
            background: #fff;
            color: var(--text);
            box-shadow: none;
            transform: translateZ(0);
        }

            .search-box input::placeholder {
                font-size: 16px;
                color: #8b8f98;
                opacity: 1;
            }

            .search-box input:focus {
                font-size: 16px !important;
                transform: none;
            }

    /* Esto evita que las alertas queden debajo del notch / Dynamic Island */
    .alert-stack {
        top: max(12px, calc(env(safe-area-inset-top) + 12px)) !important;
        left: max(12px, calc(env(safe-area-inset-left) + 12px)) !important;
        right: max(12px, calc(env(safe-area-inset-right) + 12px)) !important;
        width: auto;
        max-width: none;
    }

    /* También protege el modal para que no se pegue al notch */
    .transaction-modal-backdrop {
        padding-top: max(16px, calc(env(safe-area-inset-top) + 12px));
        padding-left: max(16px, calc(env(safe-area-inset-left) + 12px));
        padding-right: max(16px, calc(env(safe-area-inset-right) + 12px));
        padding-bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
    }
}
/* =========================================
   FIX REAL IPHONE - INPUT CONTRATO + ALERTAS
========================================= */

html {
    -webkit-text-size-adjust: 100%;
}

@supports (-webkit-touch-callout: none) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 760px) {
    .hero,
    .hero-card,
    .search-box {
        overflow: visible;
    }

    .search-box {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

        .search-box input,
        #txtContrato {
            display: block !important;
            -webkit-appearance: none !important;
            appearance: none !important;
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            flex: 0 0 auto !important;
            box-sizing: border-box !important;
            height: 56px !important;
            min-height: 56px !important;
            padding: 0 16px !important;
            margin: 0 !important;
            border: none !important;
            border-radius: 14px !important;
            background: #fff !important;
            color: var(--text) !important;
            font-size: 16px !important;
            line-height: 56px !important;
            outline: none !important;
            box-shadow: none !important;
            transform: translateZ(0);
            zoom: 1;
        }

            .search-box input::placeholder,
            #txtContrato::placeholder {
                font-size: 16px !important;
                line-height: normal !important;
                color: #8b8f98 !important;
                opacity: 1 !important;
            }

            .search-box input:focus,
            #txtContrato:focus {
                font-size: 16px !important;
                line-height: 56px !important;
                transform: none !important;
            }

        .search-box .btn-primary,
        .search-box button {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            flex: 0 0 auto !important;
        }

    .alert-stack {
        top: calc(env(safe-area-inset-top) + 12px) !important;
        left: calc(env(safe-area-inset-left) + 12px) !important;
        right: calc(env(safe-area-inset-right) + 12px) !important;
        width: auto !important;
        max-width: none !important;
        z-index: 100001 !important;
    }

    .transaction-modal-backdrop {
        padding-top: calc(env(safe-area-inset-top) + 16px) !important;
        padding-left: calc(env(safe-area-inset-left) + 16px) !important;
        padding-right: calc(env(safe-area-inset-right) + 16px) !important;
        padding-bottom: calc(env(safe-area-inset-bottom) + 16px) !important;
    }
}