/* ============================================================
   Custom Payment Options Calculator – Product Page
   ============================================================ */

.payment-options-calculator {
    margin: 24px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    padding: 24px;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────── */
.payment-options-header {
    margin-bottom: 20px;
}

.payment-options-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-options-icon {
    font-size: 1.3rem;
}

.payment-options-subtitle {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ── Price Input ────────────────────────────────────── */
.payment-calc-input {
    margin-bottom: 20px;
}

.payment-calc-input label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: #333;
}

.payment-calc-amount-input {
    width: 100%;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.payment-calc-amount-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.payment-calc-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #999;
}

/* ── Tabs ───────────────────────────────────────────── */
.payment-options-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.payment-tab {
    padding: 10px 16px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: #555;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
}

.payment-tab:hover {
    background: #f0f0f0;
    color: #1a1a2e;
}

.payment-tab.active {
    background: #fff;
    color: #2563eb;
    border-color: #e0e0e0;
    border-bottom-color: #fff;
    font-weight: 600;
}

/* ── Panels ─────────────────────────────────────────── */
.payment-options-panels {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 24px;
}

.payment-panel {
    display: none;
}

.payment-panel.active {
    display: block;
}

.payment-panel-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* ── Calculator Controls ────────────────────────────── */
.calc-control {
    margin-bottom: 16px;
}

.calc-control label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: #444;
}

.calc-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 180px;
    background: #fff;
}

.calc-select:focus {
    outline: none;
    border-color: #2563eb;
}

.calc-range {
    width: 100%;
    max-width: 300px;
    margin: 4px 0;
    accent-color: #2563eb;
}

.calc-range-value {
    display: inline-block;
    font-weight: 700;
    color: #2563eb;
    font-size: 1rem;
    margin-left: 8px;
}

/* ── Results ────────────────────────────────────────── */
.calc-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.calc-result {
    background: #f7f9fc;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #eaeef3;
}

.calc-result-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}

.calc-result-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
}

.onetime-result {
    background: linear-gradient(135deg, #ebf5ff 0%, #f0f7ff 100%);
    border-color: #b3d4fc;
}

.onetime-result .calc-result-value {
    font-size: 1.5rem;
    color: #2563eb;
}

.calc-note {
    font-size: 0.8125rem;
    color: #888;
    margin-top: 12px;
    font-style: italic;
}

/* ── Milestone List ─────────────────────────────────── */
.milestone-list {
    margin-top: 8px;
}

.milestone-items {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #333;
}

.milestone-item:last-child {
    border-bottom: none;
}

.milestone-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}

/* ── Custom / Contact Button ────────────────────────── */
.custom-payment-info {
    text-align: center;
    padding: 16px 0;
}

.custom-payment-info p {
    color: #555;
    margin-bottom: 16px;
}

.payment-contact-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.payment-contact-btn:hover {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .payment-options-calculator {
        padding: 16px;
    }

    .payment-options-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .payment-options-tabs::-webkit-scrollbar {
        display: none;
    }

    .payment-tab {
        font-size: 0.75rem;
        padding: 8px 12px;
    }

    .calc-results-grid {
        grid-template-columns: 1fr;
    }

    .payment-options-panels {
        padding: 16px;
    }

    .payment-checkout-action {
        padding: 16px;
    }
}

/* ── Checkout Action Button ────────────────────────── */
.payment-checkout-action {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef5 100%);
    border: 2px solid #1a5276;
    border-radius: 8px;
    text-align: center;
}

.payment-checkout-btn {
    display: inline-block;
    width: 100%;
    max-width: 400px;
    padding: 16px 40px;
    background: #1a5276;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.payment-checkout-btn:hover {
    background: #154360;
    transform: translateY(-1px);
}

.payment-checkout-btn:active {
    transform: translateY(0);
}

.payment-checkout-btn:disabled {
    background: #8faabe;
    cursor: not-allowed;
    transform: none;
}

.payment-checkout-hint {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    color: #666;
}

/* ============================================================
   License Agreement Modal
   ============================================================ */

.la-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.la-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────── */
.la-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.la-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.la-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
}

.la-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* ── Body ────────────────────────────────────────── */
.la-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.la-section {
    margin-bottom: 24px;
}

.la-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.la-section-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Agreement text container ────────────────────── */
.la-instruction {
    font-size: 0.875rem;
    color: #555;
    margin: 0 0 12px;
}

.la-text-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 16px;
    background: #fcfcfc;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #333;
}

.la-text-container::-webkit-scrollbar {
    width: 8px;
}

.la-text-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.la-text-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.la-text-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ── Scroll status ───────────────────────────────── */
.la-scroll-status {
    margin-top: 8px;
    font-size: 0.8125rem;
    text-align: center;
}

.la-scroll-prompt {
    color: #d97706;
    font-weight: 600;
}

.la-scroll-complete {
    color: #16a34a;
    font-weight: 600;
}

/* ── Signature ───────────────────────────────────── */
.la-sig-mode-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.la-sig-mode-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
}

.la-sig-mode-option input[type="radio"] {
    accent-color: #2563eb;
}

.la-signature-canvas {
    display: block;
    width: 100%;
    height: 180px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.la-canvas-instruction {
    font-size: 0.8125rem;
    color: #888;
    margin: 0 0 8px;
}

.la-canvas-controls {
    margin-top: 8px;
}

.la-canvas-controls .action.secondary {
    padding: 6px 16px;
    font-size: 0.8125rem;
}

.la-typed-section .field {
    margin-bottom: 12px;
}

.la-typed-section .field .label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: #333;
}

.la-typed-section .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.la-typed-section .input-text:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.la-typed-section .field.choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.la-typed-section .field.choice .checkbox {
    margin-top: 3px;
    accent-color: #2563eb;
}

.la-typed-section .field.choice .label {
    font-weight: 400;
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ── Company section ─────────────────────────────── */
#la-company-section .field .label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: #333;
}

#la-company-section .optional-label {
    font-weight: 400;
    color: #999;
    font-size: 0.8125rem;
}

#la-company-section .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

#la-company-section .input-text:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── ID upload ───────────────────────────────────── */
.la-upload-instruction {
    font-size: 0.875rem;
    color: #555;
    margin: 0 0 12px;
}

.la-upload-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.la-upload-zone:hover {
    border-color: #2563eb;
    background: #f0f4ff;
}

.la-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.la-upload-label .upload-icon {
    font-size: 2rem;
}

.la-upload-label .file-selected {
    font-weight: 600;
    color: #16a34a;
}

.la-upload-label .change-file {
    font-size: 0.8125rem;
    color: #888;
}

.la-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.la-upload-help {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #999;
}

.la-id-preview {
    margin-top: 12px;
    text-align: center;
}

.la-id-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ── Error message ───────────────────────────────── */
#la-error-message {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.875rem;
}

/* ── Footer ──────────────────────────────────────── */
.la-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.la-modal-footer .action.secondary {
    padding: 12px 24px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.la-modal-footer .action.secondary:hover {
    background: #e0e0e0;
}

.la-sign-btn {
    padding: 12px 32px;
    background: #1a5276;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.la-sign-btn:hover {
    background: #154360;
}

.la-sign-btn:disabled {
    background: #8faabe;
    cursor: not-allowed;
}

/* ── Modal Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .la-modal-overlay {
        padding: 10px;
    }

    .la-modal {
        max-height: 95vh;
    }

    .la-modal-header {
        padding: 16px;
    }

    .la-modal-body {
        padding: 16px;
    }

    .la-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .la-modal-footer .action.secondary,
    .la-sign-btn {
        width: 100%;
        text-align: center;
    }

    .la-text-container {
        max-height: 180px;
    }

    .la-sig-mode-toggle {
        flex-direction: column;
        gap: 8px;
    }
}
