@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --border: #dde3ed;
    --border-focus: #009ee3;
    --text-primary: #1a2233;
    --text-muted: #6b7d99;
    --accent: #009ee3;
    --accent-hover: #007fba;
    --accent-dark: #006699;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius-sm: 8px;
    --shadow: 0 4px 32px rgba(0,0,0,.10);
    --font: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'DM Mono', monospace;
}

html, body {
    height: 100%;
    background: var(--bg);
    font-family: var(--font);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

    /* Cuadrícula de fondo */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: linear-gradient(rgba(0,158,227,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,158,227,.05) 1px, transparent 1px);
        background-size: 36px 36px;
        pointer-events: none;
        z-index: 0;
    }

    /* Halo azul superior */
    body::after {
        content: '';
        position: fixed;
        top: -100px;
        left: 50%;
        transform: translateX(-50%);
        width: 560px;
        height: 280px;
        background: radial-gradient(ellipse, rgba(0,158,227,.08) 0%, transparent 70%);
        pointer-events: none;
        z-index: 0;
    }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.checkout-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.checkout-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    animation: fadeUp .4s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.checkout-header {
    text-align: center;
    margin-bottom: 2rem;
}

.mp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: .45rem 1.2rem;
    margin-bottom: 1.25rem;
}

.checkout-header h1 {
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -.3px;
}

.subtitle {
    color: var(--text-muted);
    font-size: .9rem;
    margin-top: .3rem;
}

/* ── Formulario ───────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.2rem;
}

    .form-group label {
        display: block;
        font-size: .78rem;
        font-weight: 500;
        color: var(--text-muted);
        letter-spacing: .4px;
        text-transform: uppercase;
        margin-bottom: .4rem;
    }

.form-control {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .95rem;
    padding: .72rem 1rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

    .form-control::placeholder {
        color: #aab4c4;
    }

    .form-control:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 3px rgba(0,158,227,.12);
        background: #fff;
    }

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

.amount-field {
    padding-left: 2rem !important;
    padding-right: 3.5rem !important;
}

.currency-code {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .5px;
    pointer-events: none;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ── Utilidades ───────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Resumen ──────────────────────────────────────────────────────────────── */
.payment-summary {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .875rem;
    padding: .35rem 0;
    color: var(--text-muted);
}

    .summary-row strong {
        color: var(--text-primary);
        font-weight: 500;
    }

    .summary-row.total {
        border-top: 1px solid var(--border);
        margin-top: .4rem;
        padding-top: .7rem;
        font-size: .95rem;
    }

        .summary-row.total strong {
            color: var(--accent);
            font-size: 1.05rem;
            font-weight: 600;
        }

/* ── Mensajes ─────────────────────────────────────────────────────────────── */
.payment-messages {
    font-size: .875rem;
    color: var(--danger);
    margin-bottom: 1rem;
    min-height: 1.2rem;
    text-align: center;
}

    .payment-messages.info {
        color: var(--accent);
    }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.btn-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    padding: .85rem 1.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(0,158,227,.25);
    margin-top: .25rem;
    margin-bottom: .75rem;
}

    .btn-pay:hover:not(:disabled) {
        background: var(--accent-hover);
        box-shadow: 0 6px 24px rgba(0,158,227,.35);
        transform: translateY(-1px);
    }

    .btn-pay:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-pay:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-focus);
    color: var(--accent);
    box-shadow: none;
}

    .btn-outline:hover:not(:disabled) {
        background: rgba(0,158,227,.06);
        box-shadow: none;
    }

.btn-back {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .875rem;
    padding: .55rem 1rem;
    cursor: pointer;
    margin-top: .75rem;
    transition: border-color .15s, color .15s;
}

    .btn-back:hover {
        border-color: var(--border-focus);
        color: var(--text-primary);
    }

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

    .spinner.hidden {
        display: none;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Nota de seguridad ────────────────────────────────────────────────────── */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: 1.4rem;
    text-align: center;
}

/* ── Resultado ────────────────────────────────────────────────────────────── */
.result-card {
    text-align: center;
}

.result-icon {
    margin: 0 auto 1.5rem;
    width: 72px;
    height: 72px;
}

    .result-icon svg {
        width: 100%;
        height: 100%;
    }

.success-icon svg {
    filter: drop-shadow(0 0 10px rgba(22,163,74,.25));
}

.error-icon svg {
    filter: drop-shadow(0 0 10px rgba(220,38,38,.25));
}

.pending-icon svg {
    filter: drop-shadow(0 0 10px rgba(217,119,6,.25));
}

.result-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.result-subtitle {
    color: var(--text-muted);
    font-size: .925rem;
    margin-bottom: 1.75rem;
}

.pi-id {
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .checkout-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }
}

/* Agregar al final de site.css */

.logs-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: .35rem .7rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: color .15s, border-color .15s;
}

    .logs-link:hover {
        color: var(--accent);
        border-color: var(--border-focus);
    }
