/**
 * Payment Page Stylesheet (Referensi: quiz_page.css)
 * File: wp-content/themes/astra-child/payment_page.css
 * Desain Mobile-First selaras dengan gaya Quiz, Flashcard & Home Tenmad:
 * - Latar belakang langit khas Tenmad (#77c9f8)
 * - Kartu putih berbayang lembut (border-radius: 15px, box-shadow: 0 10px 25px rgba(0,0,0,0.1))
 * - Kotak dalam bernuansa abu-kebiruan (#dfe8f5)
 * - Warna aksen hijau Tenmad (#91bd35 / hover: #82ab2e) & teks tebal berbayang
 */

/* ==========================================================================
   1. RESET & GLOBAL OVERRIDES (SEPERTI QUIZ_PAGE.CSS)
   ========================================================================== */
header.entry-header,
.ast-main-header-wrap,
#ast-scroll-top {
    display: none !important;
}

#primary,
#main,
.site-main,
.site-content,
.ast-container,
#content {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

html,
body {
    background: #77c9f8 !important;
    background-color: #77c9f8 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: sans-serif !important;
    box-sizing: border-box;
}

/* ==========================================================================
   2. MAIN WRAPPER (MAX-WIDTH 400PX SEPERTI QUIZ_PAGE.CSS)
   ========================================================================== */
.payment-page-container,
.tenmad-payment-container {
    width: 100%;
    max-width: 600px !important;
    margin: 0 auto;
    padding: 10px 12px calc(24px + env(safe-area-inset-bottom, 0px)) 12px;
    box-sizing: border-box;
    display: block;
    min-height: 100vh;
    font-family: sans-serif;
    color: #2a2a2a;
}

/* Header Halaman (Gaya Header Quiz) */
.payment-page-header {
    text-align: center;
    margin-bottom: 14px;
    position: relative;
}

.payment-page-title-row {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

.payment-page-title-row::after {
    content: "";
    display: block;
    width: 36px;
}

.payment-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    color: #ffffff;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    outline: none !important;
    cursor: pointer;
}

.payment-back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: translateY(-1px) scale(1.05);
}

.payment-back-btn:active {
    transform: scale(0.95);
}

.payment-page-title {
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
    text-align: center;
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25);
    line-height: 1.25;
}

/* ==========================================================================
   3. KARTU INSTRUKSI REKENING (FLASHCARD STYLE)
   ========================================================================== */
.payment-instruction-card {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 16px 14px;
    margin-bottom: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.bank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #dfe8f5;
    color: #2a2a2a;
    border: 1px solid #bdc9db;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: bold;
    margin-bottom: 10px;
}

.bank-icon {
    font-size: 13px;
}

.account-details-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background-color: #dfe8f5; /* Warna box question di quiz_page */
    border: 1.5px solid #bdc9db;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.account-info {
    display: flex;
    flex-direction: column;
}

.account-label {
    font-size: 11px;
    color: #475569;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.account-number {
    font-size: 21px;
    font-weight: bold;
    color: #2a2a2a;
    letter-spacing: 1.5px;
    font-family: monospace;
    margin: 2px 0;
    word-break: break-all;
}

.account-holder {
    font-size: 12px;
    color: #555555;
    font-weight: bold;
}

.btn-copy-account {
    width: 100%;
    height: 42px;
    background-color: #2a2a2a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-copy-account:hover {
    background-color: #444444;
}

.btn-copy-account:active {
    transform: scale(0.98);
}

/* ==========================================================================
   4. KARTU FORMULIR PEMBAYARAN (FLASHCARD CONTAINER STYLE)
   ========================================================================== */
.payment-form-card {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #2a2a2a;
    margin-bottom: 5px;
}

.required-star {
    color: #de8945; /* Warna orange Tenmad / salah di quiz */
}

.form-input {
    width: 100%;
    height: 46px;
    background-color: #f8fafc;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 16px; /* Mencegah auto-zoom di iOS */
    color: #2a2a2a;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-family: sans-serif;
}

.form-input:focus {
    border-color: #91bd35; /* Hijau Tenmad saat fokus */
    outline: none;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(145, 189, 53, 0.2);
}

.form-input[readonly] {
    background-color: #f1f5f9;
    color: #777777;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.field-hint {
    display: block;
    font-size: 11px;
    color: #666666;
    margin-top: 4px;
    line-height: 1.35;
}

/* ==========================================================================
   5. PILIHAN PAKET (SEPERTI QUIZ OPTIONS GRID)
   ========================================================================== */
.packages-selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.package-card {
    position: relative;
    background-color: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
}

.package-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.package-card:active {
    transform: scale(0.98);
}

/* Kartu Terpilih: Hijau Tenmad (#91bd35) */
.package-card.selected {
    border-color: #91bd35;
    background-color: #f0fdf4;
    box-shadow: 0 4px 12px rgba(145, 189, 53, 0.25);
}

.package-radio {
    display: none;
}

.package-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.package-name {
    font-size: 14px;
    font-weight: bold;
    color: #2a2a2a;
}

.package-badge {
    background-color: #dfe8f5;
    color: #2a2a2a;
    font-size: 10.5px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #bdc9db;
}

.package-card.selected .package-badge {
    background-color: #91bd35;
    color: #ffffff;
    border-color: #91bd35;
}

.package-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pkg-old-price {
    font-size: 11px;
    color: #888888;
    text-decoration: line-through;
}

.pkg-current-price {
    font-size: 16px;
    font-weight: bold;
    color: #2a2a2a;
}

.package-card.selected .pkg-current-price {
    color: #91bd35;
}

/* ==========================================================================
   6. VOUCHER INPUT & FEEDBACK
   ========================================================================== */
.voucher-input-wrapper {
    display: flex;
    gap: 6px;
}

.voucher-field {
    flex: 1;
    min-width: 0;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.btn-apply-voucher {
    height: 46px;
    padding: 0 16px;
    background-color: #91bd35;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.btn-apply-voucher:hover {
    background-color: #82ab2e;
}

.btn-apply-voucher:active {
    transform: scale(0.96);
}

.btn-apply-voucher:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.voucher-feedback {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
}

.feedback-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #91bd35;
}

.feedback-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #de8945;
}

/* ==========================================================================
   7. KOTAK RINGKASAN BIAYA (INNER BOX STYLE)
   ========================================================================== */
.payment-summary-box {
    background-color: #dfe8f5;
    border: 1.5px solid #bdc9db;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 16px 0;
    box-sizing: border-box;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px;
}

.summary-row strong {
    color: #2a2a2a;
}

.summary-total-row {
    border-top: 1px dashed #bdc9db;
    padding-top: 8px;
    margin-top: 8px;
    margin-bottom: 2px;
}

.summary-total-row span {
    font-size: 13.5px;
    font-weight: bold;
    color: #2a2a2a;
}

.total-price-display {
    font-size: 19px;
    font-weight: bold;
    color: #2a2a2a;
}

.summary-note {
    font-size: 11px;
    color: #64748b;
    margin: 4px 0 0 0;
    font-style: italic;
    line-height: 1.35;
}

/* Notifikasi Pesan Form */
.payment-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: bold;
    margin-bottom: 14px;
    line-height: 1.4;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #de8945;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1.5px solid #91bd35;
}

/* ==========================================================================
   8. TOMBOL SUBMIT UTAMA (GAYA TOMBOL QUIZ_PAGE.CSS: #91bd35)
   ========================================================================== */
.payment-submit-btn {
    width: 100%;
    min-height: 48px;
    padding: 14px;
    background-color: #91bd35;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(145, 189, 53, 0.35);
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
    box-sizing: border-box;
}

.payment-submit-btn:hover {
    background-color: #82ab2e;
}

.payment-submit-btn:active {
    transform: scale(0.98);
}

.payment-submit-btn.btn-free-mode {
    background-color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.payment-submit-btn.btn-free-mode:hover {
    background-color: #047857;
}

.payment-submit-btn:disabled {
    background-color: #cccccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ==========================================================================
   9. POP-UP OVERLAY (SEPERTI QUIZ-MODAL-OVERLAY & QUIZ-MODAL-CONTENT)
   ========================================================================== */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    box-sizing: border-box;
}

.payment-modal-card {
    background: #ffffff;
    border-radius: 15px;
    max-width: 340px;
    width: 90%;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.2s ease-out;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
    color: #2a2a2a;
    margin: 0 0 4px 0;
}

.modal-subtitle {
    font-size: 12px;
    color: #666666;
    margin: 0 0 14px 0;
    line-height: 1.45;
}

/* Box Nominal Transfer Unik di Modal */
.modal-amount-box {
    background-color: #dfe8f5;
    border: 1.5px solid #bdc9db;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: left;
}

.modal-amount-label {
    display: block;
    font-size: 10.5px;
    font-weight: bold;
    color: #475569;
    letter-spacing: 0.5px;
}

.modal-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 4px 0;
}

.modal-amount-number {
    font-size: 22px;
    font-weight: bold;
    color: #91bd35;
    letter-spacing: 0.5px;
    font-family: sans-serif;
}

.modal-unique-note {
    font-size: 11px;
    color: #555555;
    line-height: 1.35;
    border-top: 1px dashed #bdc9db;
    padding-top: 5px;
    margin-top: 4px;
}

.unique-highlight {
    background: #ffffff;
    color: #15803d;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #91bd35;
}

/* Box Bank di Modal */
.modal-bank-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 6px;
}

.modal-bank-info {
    display: flex;
    flex-direction: column;
}

.modal-bank-name {
    font-size: 11px;
    font-weight: bold;
    color: #2a2a2a;
}

.modal-acc-num {
    font-size: 16px;
    font-weight: bold;
    color: #2a2a2a;
    letter-spacing: 1px;
    font-family: monospace;
    margin: 2px 0;
}

.modal-acc-holder {
    font-size: 11px;
    color: #666666;
}

.btn-copy-chip {
    background-color: #2a2a2a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.btn-copy-chip:hover {
    background-color: #444444;
}

.btn-copy-chip:active {
    transform: scale(0.96);
}

.modal-order-tag {
    font-size: 11.5px;
    color: #666666;
    margin-bottom: 12px;
}

.modal-order-tag strong {
    color: #2a2a2a;
}

.btn-open-wa-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 46px;
    background-color: #91bd35; /* Hijau Tenmad */
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(145, 189, 53, 0.35);
    transition: background-color 0.2s, transform 0.1s;
    box-sizing: border-box;
    padding: 10px 12px;
    line-height: 1.35;
    font-family: inherit;
}

.btn-open-wa-modal:hover {
    background-color: #82ab2e;
}

.btn-open-wa-modal:active {
    transform: scale(0.98);
}

.wa-btn-icon {
    font-size: 16px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: #888888;
    font-size: 12.5px;
    font-weight: bold;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s ease;
    font-family: inherit;
}

.btn-close-modal:hover {
    color: #2a2a2a;
}

/* ==========================================================================
   10. PROGRESSIVE ENHANCEMENT (TABLET / DESKTOP)
   ========================================================================== */
@media (min-width: 480px) {
    .payment-page-container,
    .tenmad-payment-container {
        padding: 16px 16px 40px;
    }

    .account-details-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .btn-copy-account {
        width: auto;
        padding: 8px 14px;
    }

    .packages-selection-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (min-width: 640px) {
    .payment-page-container,
    .tenmad-payment-container {
        max-width: 400px;
        padding: 24px 16px 50px;
    }

    .payment-page-title {
        font-size: 24px;
    }

    .payment-form-card {
        padding: 24px 20px;
    }

    .form-input {
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .payment-page-title-row {
        grid-template-columns: 32px 1fr 32px;
    }

    .payment-page-title-row::after {
        width: 32px;
    }

    .payment-back-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .payment-page-title {
        font-size: 18px;
    }
}
