/* =============================================
   EasyLend Financial - Pre-Qualification Form
   Colors: Gold #FED136, Black #000, Dark #222
   Fonts: Montserrat, Roboto Slab
   Meridian-inspired animations
   ============================================= */

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

body {
    font-family: 'Roboto Slab', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ---- Header ---- */
.form-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    padding: 40px 0 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.form-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FED136, transparent);
}

.form-header .logo {
    height: 60px;
    margin-bottom: 16px;
    animation: fadeSlideDown 0.6s ease-out;
}

.form-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    animation: fadeSlideDown 0.6s ease-out 0.1s both;
}

.form-header .subtitle {
    font-size: 14px;
    color: #FED136;
    font-weight: 300;
    animation: fadeSlideDown 0.6s ease-out 0.2s both;
}

.header-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 20px;
    border: 2px solid #FED136;
    border-radius: 50px;
    color: #FED136;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: fadeSlideDown 0.6s ease-out 0.3s both;
}

.header-phone:hover {
    background: #FED136;
    color: #222;
}

/* ---- Borrow Section ---- */
.borrow-section {
    background: #fff;
    padding: 44px 0 8px;
    text-align: center;
}

.borrow-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #222;
    margin-bottom: 8px;
}

.borrow-subheading {
    font-family: 'Roboto Slab', sans-serif;
    font-size: 16px;
    font-style: italic;
    color: #777;
    margin-bottom: 36px;
}

.borrow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
}

.borrow-item {
    padding: 0 6px;
}

.borrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #FED136;
    color: #222;
    font-size: 32px;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(254, 209, 54, 0.35);
}

.borrow-item h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

.borrow-item p {
    font-family: 'Roboto Slab', sans-serif;
    font-size: 14px;
    color: #777;
    line-height: 1.6;
}

.footer-address {
    font-family: 'Roboto Slab', sans-serif;
    font-size: 13px;
    color: #bbb;
    margin-bottom: 6px;
}

.footer-phone {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #FED136;
    margin-bottom: 6px;
}

.footer-phone a {
    color: #FED136;
    text-decoration: none;
}

.footer-phone a:hover {
    color: #fff;
}

/* ---- Animations ---- */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeSlideLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(254, 209, 54, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(254, 209, 54, 0); }
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes slideProgress {
    from { width: 0; }
}

@keyframes resultReveal {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    60% { transform: translateY(-5px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes iconPop {
    0% { opacity: 0; transform: scale(0) rotate(-10deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---- Progress Bar ---- */
.progress-container {
    background: #fff;
    padding: 24px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    cursor: default;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.4, 1);
}

.progress-step.active .step-circle {
    background: #FED136;
    color: #222;
    box-shadow: 0 0 0 4px rgba(254, 209, 54, 0.25);
    animation: pulseGlow 2s ease infinite;
}

.progress-step.completed .step-circle {
    background: #222;
    color: #FED136;
    transform: scale(1);
}

.progress-step.completed .step-circle::after {
    content: '\f00c';
    font-family: FontAwesome;
    font-size: 14px;
    animation: checkBounce 0.4s ease;
}

.progress-step.completed .step-number {
    display: none;
}

.step-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.progress-step.active .step-label {
    color: #222;
}

.progress-step.completed .step-label {
    color: #222;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    max-width: 60px;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 4px;
    margin-bottom: 20px;
}

.progress-line-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FED136, #FEC503);
    transition: width 0.6s cubic-bezier(0.19, 1, 0.4, 1);
    border-radius: 2px;
}

/* ---- Form Main ---- */
.form-main {
    flex: 1;
    padding: 32px 0 40px;
}

.form-tab {
    display: none;
}

.form-tab.active {
    display: block;
    animation: fadeSlideUp 0.5s cubic-bezier(0.19, 1, 0.4, 1);
}

.form-tab .form-group {
    animation: fadeSlideUp 0.5s cubic-bezier(0.19, 1, 0.4, 1) both;
}

.form-tab .form-group:nth-child(1) { animation-delay: 0.05s; }
.form-tab .form-group:nth-child(2) { animation-delay: 0.1s; }
.form-tab .form-group:nth-child(3) { animation-delay: 0.15s; }
.form-tab .form-group:nth-child(4) { animation-delay: 0.2s; }
.form-tab .form-group:nth-child(5) { animation-delay: 0.25s; }
.form-tab .form-group:nth-child(6) { animation-delay: 0.3s; }

.form-tab .form-row {
    animation: fadeSlideUp 0.5s cubic-bezier(0.19, 1, 0.4, 1) both;
}

.form-tab .form-row:nth-child(2) { animation-delay: 0.1s; }
.form-tab .form-row:nth-child(3) { animation-delay: 0.15s; }
.form-tab .form-row:nth-child(4) { animation-delay: 0.2s; }

.tab-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
    animation: fadeSlideRight 0.5s cubic-bezier(0.19, 1, 0.4, 1);
}

.tab-title i {
    color: #FED136;
    margin-right: 8px;
}

.tab-desc {
    color: #777;
    font-size: 14px;
    margin-bottom: 28px;
    animation: fadeSlideRight 0.5s cubic-bezier(0.19, 1, 0.4, 1) 0.05s both;
}

/* ---- Form Groups ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group > label:first-child {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #E74C3C;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Roboto Slab', sans-serif;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #FED136;
    box-shadow: 0 0 0 3px rgba(254, 209, 54, 0.2);
    transform: translateY(-1px);
}

input.error,
select.error {
    border-color: #E74C3C;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.error-msg {
    display: block;
    color: #E74C3C;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
    transition: opacity 0.3s ease;
}

/* ---- Input with icon prefix ---- */
.input-icon {
    position: relative;
}

.icon-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-weight: 600;
    font-size: 15px;
}

.input-icon input {
    padding-left: 28px;
}

/* ---- Radio Cards ---- */
.radio-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-cards.small .radio-card-content {
    padding: 14px 10px;
}

.radio-cards.small .radio-card-content i {
    font-size: 18px;
}

.radio-card {
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.4, 1);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.radio-card-content i {
    color: #999;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.4, 1);
}

.radio-card input:checked + .radio-card-content {
    border-color: #FED136;
    background: #FFF9E6;
    color: #222;
    box-shadow: 0 4px 12px rgba(254, 209, 54, 0.25);
    transform: translateY(-2px);
}

.radio-card input:checked + .radio-card-content i {
    color: #FED136;
    transform: scale(1.15);
}

.radio-card-content:hover {
    border-color: #ccc;
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ---- Option Pills ---- */
.option-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    cursor: pointer;
}

.pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pill span {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.4, 1);
    white-space: nowrap;
}

.pill input:checked + span {
    border-color: #FED136;
    background: #FED136;
    color: #222;
    box-shadow: 0 2px 8px rgba(254, 209, 54, 0.3);
    transform: scale(1.05);
}

.pill span:hover {
    border-color: #ccc;
    background: #fafafa;
    transform: translateY(-1px);
}

/* ---- Consent ---- */
.consent-group {
    margin-top: 10px;
}

.consent-label {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
}

.consent-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.4, 1);
    margin-top: 2px;
}

.consent-label input:checked ~ .checkmark {
    background: #FED136;
    border-color: #FED136;
    transform: scale(1.1);
}

.consent-label input:checked ~ .checkmark::after {
    content: '\f00c';
    font-family: FontAwesome;
    font-size: 12px;
    color: #222;
    animation: checkBounce 0.4s ease;
}

.consent-text {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.consent-text a {
    color: #D4A017;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.consent-text a:hover {
    color: #FED136;
}

/* ---- Business fields toggle ---- */
.hidden {
    display: none !important;
}

.business-fields {
    animation: fadeSlideUp 0.4s cubic-bezier(0.19, 1, 0.4, 1);
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 10px;
}

/* ---- Navigation Buttons ---- */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    animation: fadeSlideUp 0.5s ease 0.3s both;
}

.btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.4, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-prev {
    background: transparent;
    color: #999;
    border: 2px solid #e0e0e0;
}

.btn-prev:hover {
    color: #222;
    border-color: #222;
    transform: translateX(-3px);
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, #FED136, #FEC503);
    color: #222;
    box-shadow: 0 2px 8px rgba(254, 209, 54, 0.2);
}

.btn-next:hover,
.btn-submit:hover {
    background: linear-gradient(135deg, #FEC503, #F5B800);
    box-shadow: 0 6px 20px rgba(254, 209, 54, 0.4);
    transform: translateY(-2px);
}

.btn-next:active,
.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(254, 209, 54, 0.3);
}

.btn-submit {
    display: none;
}

/* First-tab call-to-action button */
.btn-qualify {
    text-transform: none;
    letter-spacing: 0.3px;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
    text-align: center;
    padding: 12px 28px;
}

.btn-qualify .btn-sub {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    text-transform: none;
    letter-spacing: 0.2px;
}

#prevBtn {
    visibility: hidden;
}

/* ---- Result Screen ---- */
.result-screen {
    text-align: center;
}

.result-content {
    background: #fff;
    border-radius: 16px;
    padding: 48px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    animation: resultReveal 0.7s cubic-bezier(0.19, 1, 0.4, 1);
}

.result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: iconPop 0.6s cubic-bezier(0.19, 1, 0.4, 1) 0.3s both;
}

.result-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    animation: fadeSlideUp 0.5s ease 0.5s both;
}

.result-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.6;
    animation: fadeSlideUp 0.5s ease 0.6s both;
}

.result-details {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
    animation: fadeSlideUp 0.5s ease 0.7s both;
}

.result-details p {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.result-details p:last-child {
    border-bottom: none;
}

.result-details strong {
    color: #222;
}

.result-disclaimer {
    font-size: 12px;
    color: #999;
    margin-bottom: 24px;
    font-style: italic;
    animation: fadeSlideUp 0.5s ease 0.8s both;
}

/* Result tier colors */
.result-approved .result-title { color: #27AE60; }
.result-approved .result-content { border-top: 4px solid #27AE60; }
.result-conditional .result-title { color: #F39C12; }
.result-conditional .result-content { border-top: 4px solid #F39C12; }
.result-review .result-title { color: #3498DB; }
.result-review .result-content { border-top: 4px solid #3498DB; }
.result-declined .result-title { color: #E74C3C; }
.result-declined .result-content { border-top: 4px solid #E74C3C; }

/* ---- Loading spinner ---- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 34, 34, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #555;
    border-top-color: #FED136;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: #FED136;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading-steps {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-step {
    color: #666;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    transition: all 0.4s ease;
    opacity: 0;
}

.loading-step.active {
    color: #FED136;
    opacity: 1;
    transform: translateX(5px);
}

.loading-step.done {
    color: #27AE60;
    opacity: 0.7;
}

/* ---- Footer ---- */
.form-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #999;
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
}

.footer-links {
    margin-top: 6px;
}

.footer-links a {
    color: #FED136;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .form-header h1 {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .borrow-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .header-phone {
        font-size: 13px;
    }

    .btn-next.btn-qualify {
        font-size: 12px;
        letter-spacing: 0.5px;
        padding: 14px 18px;
    }

    .form-header .subtitle {
        font-size: 12px;
    }

    .progress-step {
        min-width: 50px;
    }

    .step-label {
        font-size: 9px;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .progress-line {
        max-width: 30px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .radio-cards {
        grid-template-columns: 1fr;
    }

    .option-pills {
        gap: 6px;
    }

    .pill span {
        padding: 8px 14px;
        font-size: 12px;
    }

    .form-nav {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    #prevBtn {
        order: 2;
    }

    .tab-title {
        font-size: 18px;
    }

    .result-title {
        font-size: 22px;
    }

    .result-content {
        padding: 32px 20px;
    }
}
