:root {
    --bg-light: #f4fdf8;
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --secondary: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 1);
    --text-main: #0f172a;
    --text-muted: #475569;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary), transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #15803d, transparent 70%);
    animation-delay: -10s;
    transform: translateX(-50%);
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 50px) scale(1.1); }
    100% { transform: translate(-30px, -20px) scale(0.9); }
}

/* Layout */
.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #000000, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.partnership-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #166534;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 999px;
}

.partnership-badge strong {
    font-weight: 700;
    color: #15803d;
}

.partnership-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.75); }
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 3rem;
}

/* Input Section */
.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.prefix, .suffix {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    user-select: none;
}

.prefix { padding-right: 0.5rem; }
.suffix { padding-left: 0.5rem; font-size: 0.9rem; }

input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: inherit;
    padding: 1rem 0;
    width: 100%;
    outline: none;
}

input[type="number"]:first-child {
    padding-left: 1rem;
}

/* Remove Arrows from Number Input */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] { -moz-appearance: textfield; }

/* Divider */
.divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--glass-border), transparent);
}

/* Results Section */
.results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-result {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.result-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #166534, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-break: break-all;
}

.secondary-results {
    display: flex;
    gap: 2rem;
}

.secondary-results .result-card {
    flex: 1;
}

.result-value.small {
    font-size: 1.5rem;
    background: #0f172a;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Button */
.apply-btn {
    margin-top: auto;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.6);
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        gap: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .glass-panel {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .input-section {
        gap: 1rem;
    }

    .divider {
        width: 100%;
        height: 1px;
        margin: 0.5rem 0;
        background: linear-gradient(to right, transparent, var(--glass-border), transparent);
    }

    .results-section {
        gap: 1.5rem;
    }

    .primary-result {
        padding: 1.25rem;
    }
    
    .primary-result .result-value {
        font-size: 2.25rem;
    }

    .secondary-results {
        gap: 1rem;
    }

    .result-value.small {
        font-size: 1.25rem;
    }
}

/* ===================== */
/* PRE-APPROVAL MODAL    */
/* ===================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    position: relative;
    flex-direction: column;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    animation: slideUp 0.3s ease;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.modal-header {
    margin-bottom: 1.75rem;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.modal-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.modal-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.modal-row {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.modal-field input {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.modal-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.popia-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.popia-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.popia-checkbox span {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

/* Success state */
.success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

@media (max-width: 480px) {
    .modal-row {
        grid-template-columns: 1fr;
    }
    .modal-card {
        padding: 2rem 1.5rem;
    }
}
