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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top countdown bar */
.timer-bar {
    background: #ff0050;
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.timer-bar svg { width: 16px; height: 16px; flex-shrink: 0; }
#countdown { font-weight: 700; }

/* Page layout */
.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 40px;
    gap: 16px;
}

/* Brand card */
.brand-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 32px;
    text-align: center;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.brand-card img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    margin-bottom: 10px;
    object-fit: cover;
}

.brand-card h1 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.brand-card p {
    font-size: 13px;
    color: #888;
}

/* Payment card */
.payment-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-card h2 {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.payment-card .subtitle {
    font-size: 13px;
    color: #888;
    margin-top: -10px;
}

/* Amount box */
.amount-box {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.amount-box .label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.amount-box .value {
    font-size: 26px;
    font-weight: 700;
    color: #ff0050;
}

/* Method tabs */
.method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.tab-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    background: transparent;
    color: #666;
}

.tab-btn.active {
    background: #ff0050;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,0,80,0.3);
}

/* Form fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.field input {
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
    color: #1a1a1a;
    background: #fff;
}

.field input:focus {
    border-color: #ff0050;
}

.field input::placeholder { color: #bbb; }

/* Phone field with prefix */
.phone-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.phone-wrapper:focus-within { border-color: #ff0050; }

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 12px;
    background: #f8f8f8;
    border-right: 1.5px solid #e5e5e5;
    font-size: 14px;
    color: #444;
    flex-shrink: 0;
    white-space: nowrap;
}

.phone-prefix .flag { font-size: 18px; }

.phone-wrapper input {
    border: none;
    border-radius: 0;
    flex: 1;
    padding: 11px 14px;
    font-size: 15px;
    outline: none;
    color: #1a1a1a;
    background: transparent;
}

/* Terms checkbox */
.terms-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f8f8;
    border-radius: 8px;
    cursor: pointer;
}

.terms-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff0050;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-row label {
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.terms-row a { color: #ff0050; text-decoration: none; }
.terms-row a:hover { text-decoration: underline; }

/* Pay button */
.pay-btn {
    width: 100%;
    padding: 15px;
    background: #ff0050;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.pay-btn:hover:not(:disabled) { background: #e0003f; }
.pay-btn:active:not(:disabled) { transform: scale(0.98); }
.pay-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Pending screens */
.pending-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    text-align: center;
}

.pending-screen.visible { display: flex; }

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f0f0f0;
    border-top-color: #ff0050;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.pending-screen h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.pending-screen p {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

/* Multibanco reference box */
.reference-box {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 16px;
    width: 100%;
    text-align: left;
}

.reference-box .ref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.reference-box .ref-row:not(:last-child) {
    border-bottom: 1px solid #ebebeb;
}

.reference-box .ref-label { color: #888; }
.reference-box .ref-value { font-weight: 700; color: #1a1a1a; }

/* Error banner */
.error-banner {
    background: #fff0f3;
    border: 1.5px solid #ffb3c1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #cc0033;
    display: none;
}

.error-banner.visible { display: block; }

/* Hidden helper */
.hidden { display: none !important; }

@media (max-width: 520px) {
    .page { padding: 16px 12px 32px; }
    .brand-card, .payment-card { border-radius: 12px; }
}
