/* public/assets/css/style.css
 *
 * VULT LIGHT THEME (Telem Sounds - Powered by Vult):
 * - White base + Vult blue (#82d2e7) accents
 * - Clean, modern, friendly UI
 * - Keeps existing class hooks (no markup breakage)
 */

:root {
    /* Brand */
    --vult-blue: #82d2e7;

    /* Base */
    --color-bg: #ffffff;
    --color-bg-2: #f6fbfe;                 /* blue-tinted white */
    --color-surface: rgba(255, 255, 255, 0.78);
    --color-card-solid: #ffffff;

    /* Borders / text */
    --color-border: rgba(15, 23, 42, 0.10);
    --color-border-strong: rgba(130, 210, 231, 0.65);
    --color-text-main: rgba(15, 23, 42, 0.92);      /* slate-900-ish */
    --color-text-muted: rgba(15, 23, 42, 0.62);

    /* Accents */
    --color-primary: var(--vult-blue);
    --color-primary-soft: rgba(130, 210, 231, 0.18);
    --color-accent: rgba(15, 23, 42, 0.86);         /* dark accent for contrast */
    --color-warning: #b45309;                       /* readable amber on white */
    --color-danger: #b91c1c;

    /* Buttons */
    --color-cta: var(--vult-blue);
    --color-cta-text: rgba(15, 23, 42, 0.92);

    /* Rounding & shadows */
    --radius-lg: 1.5rem;
    --radius-md: 0.9rem;
    --radius-pill: 999px;

    --shadow-card: 0 22px 70px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 14px 36px rgba(15, 23, 42, 0.10);

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

/* Basic reset */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--color-text-main);
    background: var(--color-bg);
    overflow-x: hidden;
}

/* Light mesh background (soft + brand-forward, no images) */
body::before {
    content: "";
    position: fixed;
    inset: -50px;
    z-index: -1;
    background:
        radial-gradient(900px 560px at 10% 0%, rgba(130, 210, 231, 0.30), transparent 58%),
        radial-gradient(900px 560px at 90% 10%, rgba(130, 210, 231, 0.22), transparent 60%),
        radial-gradient(800px 520px at 50% 110%, rgba(15, 23, 42, 0.06), transparent 62%),
        linear-gradient(180deg, #ffffff 0%, var(--color-bg-2) 100%);
    filter: saturate(1.05);
}

/* Main wrapper */
.checkout-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
}

/* Header */
.checkout-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-wrap { margin-bottom: 14px; }

.merchant-logo {
    width: 132px;
    height: auto;
    object-fit: contain;
    /* On light mode, heavy shadows look dirty; keep it crisp */
    filter: none;
}

.checkout-title-block {
    max-width: 680px;
    margin: 0 auto;
}

.checkout-title {
    font-size: 2rem;
    font-weight: 780;
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}

.checkout-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* Card */
.checkout-card {
    width: 100%;
    max-width: 720px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    box-shadow: var(--shadow-card);
    padding: 32px 28px 28px;
    backdrop-filter: blur(14px);
}

/* Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Inputs */
.form-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 0.9rem;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    color: var(--color-text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-input::placeholder { color: rgba(15, 23, 42, 0.35); }

.form-input:focus {
    border-color: rgba(130, 210, 231, 0.95);
    box-shadow: 0 0 0 4px rgba(130, 210, 231, 0.22);
    background: #ffffff;
}

.form-input[readonly] {
    cursor: default;
    opacity: 0.95;
}

.field-helper {
    margin: 0;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

/* Amount display */
.amount-display {
    padding: 12px 14px;
    border-radius: 0.9rem;
    border: 1px solid var(--color-border);
    background: rgba(130, 210, 231, 0.10);
    font-size: 1.05rem;
    font-weight: 750;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amount-original {
    text-decoration: line-through;
    color: rgba(15, 23, 42, 0.40);
    font-size: 0.88rem;
}

.amount-text {
    font-weight: 820;
    color: rgba(15, 23, 42, 0.92);
}

/* Currency toggle pills (kept for compatibility; visually neutral) */
.currency-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: rgba(15, 23, 42, 0.04);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--color-border);
}

.currency-pill {
    border: none;
    border-radius: var(--radius-pill);
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 750;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-muted);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.currency-pill:hover { transform: translateY(-1px); }

.currency-pill.active {
    background: rgba(130, 210, 231, 0.35);
    color: rgba(15, 23, 42, 0.92);
}

/* Payment methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-method-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.80);
    cursor: pointer;
    box-shadow: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
}

.payment-method-card:hover {
    box-shadow: var(--shadow-soft);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.payment-method-card.active {
    border-color: rgba(130, 210, 231, 0.95);
    background: rgba(130, 210, 231, 0.12);
}

/* Icon container: consistent size + stronger visibility */
.pm-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(130, 210, 231, 0.16);
}

/* Make icons fill their space more */
.pm-icon img,
.pm-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Images: fill + stay clean (most logos have whitespace; cover makes them “feel bigger”) */
.pm-icon img {
    object-fit: cover;
    object-position: center;
}

/* SVGs: avoid touching edges */
.pm-icon svg {
    width: 28px;
    height: 28px;
    color: rgba(15, 23, 42, 0.78);
}

/* Method backgrounds (all brand-consistent now) */
.pm-icon-inapp { background: rgba(130, 210, 231, 0.22); }
.pm-icon-card  { background: rgba(130, 210, 231, 0.16); }
.pm-icon-momo  { background: rgba(130, 210, 231, 0.16); }

.pm-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: rgba(15, 23, 42, 0.92);
}

.pm-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pm-tag-warning {
    font-size: 0.8rem;
    color: var(--color-warning);
    font-weight: 800;
}

.pm-radio-indicator {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.18);
    flex-shrink: 0;
}

.payment-method-card.active .pm-radio-indicator {
    border-color: rgba(130, 210, 231, 0.95);
    box-shadow: 0 0 0 3px rgba(130, 210, 231, 0.22);
}

/* Pay button */
.pay-button {
    width: 100%;
    padding: 14px 16px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: linear-gradient(135deg, rgba(130, 210, 231, 1), rgba(130, 210, 231, 0.70));
    color: rgba(15, 23, 42, 0.92);
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.pay-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.16);
    filter: brightness(1.02);
}

.pay-button:active {
    transform: translateY(0);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

/* Loading state */
.pay-button.is-loading {
    position: relative;
    cursor: wait;
    opacity: 0.92;
}

.pay-button.is-loading::after {
    content: "";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.22);
    border-top-color: rgba(15, 23, 42, 0.78);
    animation: vult-spin 0.8s linear infinite;
}

@keyframes vult-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Awaiting payment state */
.pay-button.is-awaiting {
    cursor: not-allowed;
    opacity: 0.90;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

.pay-button.is-awaiting::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(130, 210, 231, 0.18) 50%,
        transparent 70%
    );
    animation: awaiting-shimmer 1.6s infinite;
    border-radius: inherit;
}

@keyframes awaiting-shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* Result section */
.result-section {
    margin-top: 2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    padding: 1.5rem 1.75rem;
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
    max-height: 0;
    opacity: 0;
    transform: translateY(8px);
    overflow: hidden;
}

.result-section--visible {
    max-height: 760px;
    opacity: 1;
    transform: translateY(0);
}

.result-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
}

.result-title-error { color: var(--color-danger); }

.result-text,
.result-caption {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.result-text-error { color: rgba(185, 28, 28, 0.85); }

/* Buttons for link/actions */
.primary-link-button,
.secondary-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.primary-link-button {
    background: linear-gradient(135deg, rgba(130, 210, 231, 1), rgba(130, 210, 231, 0.70));
    color: rgba(15, 23, 42, 0.92);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.primary-link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.secondary-link-button {
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.86);
    border-color: rgba(15, 23, 42, 0.10);
}

.secondary-link-button:hover {
    background: rgba(130, 210, 231, 0.16);
    border-color: rgba(130, 210, 231, 0.40);
}

/* Awaiting banner */
.awaiting-banner {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(130, 210, 231, 0.12);
    border: 1px dashed rgba(130, 210, 231, 0.55);
    display: flex;
    align-items: center;
    gap: 10px;
}

.awaiting-banner::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.18);
    border-top-color: rgba(15, 23, 42, 0.75);
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.awaiting-banner .result-text {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(15, 23, 42, 0.72);
}

/* MoMo */
.momo-code-block {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px dashed rgba(15, 23, 42, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.momo-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 750;
    color: rgba(15, 23, 42, 0.90);
    word-break: break-all;
}

/* QR block */
.qr-block {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    background: #ffffff;
    padding: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
}

/* Back link */
.checkout-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    color: rgba(15, 23, 42, 0.74);
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.10);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.checkout-back-link:hover {
    background: rgba(130, 210, 231, 0.16);
    color: rgba(15, 23, 42, 0.92);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    transform: translateY(-1px);
}

/* Footer */
.checkout-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.footer-powered {
    display: flex;
    justify-content: center;
}

.powered-by-vult {
    height: 92px;
    width: 190px;
    opacity: 0.98;
    filter: none;
}

/* Disabled controls */
button:disabled,
button[disabled] {
    pointer-events: none;
    filter: grayscale(0.1);
    opacity: 0.65;
}

/* Responsive tweaks */
@media (max-width: 640px) {
    .checkout-card {
        padding: 22px 18px 18px;
        border-radius: 1.5rem;
    }

    .checkout-title { font-size: 1.6rem; }

    .merchant-logo { width: 118px; }
}

/* Print support (receipt/failed pages) */
@media print {
    body { background: #ffffff !important; color: #111827 !important; }
    button,
    .btn,
    .btn-outline,
    .btn-secondary,
    .btn-danger-outline,
    a[href^="javascript"],
    .receipt-actions { display: none !important; }

    .receipt-card,
    .status-card {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }

    .page,
    .status-wrap { padding: 0 !important; margin: 0 !important; }
}
