:root {
    --primary-color: #ff6b6b;
    --secondary-color: #feca57;
    --text-color: #ffffff;
    --glass-bg: rgba(20, 20, 20, 0.6);
    /* Darker, more opaque glass for legibility */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('hero.png');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Darker overlay to help text pop even with less blur on the card */
.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.5) 100%);
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    height: 100vh;
    width: 100vw;
    position: relative;
    background-color: #1a1a1a;
}

/* Home Page Specifics: No Scroll, Centered */
body.home-page {
    overflow: hidden;
}

body.home-page .content-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Form Page Specifics: Scrollable, Top Aligned */
body.form-page {
    overflow-y: auto;
}

body.form-page .content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    /* Reduced blur as requested */
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2rem 3rem;
    text-align: center;
    max-width: 650px;
    margin: 0;
    width: 100%;
    animation: fadeIn 1.2s ease-out;
}

.logo {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Removed gradient text for cleaner premium look on dark glass */
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.hero-text h2 {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.apr-display {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.prefix {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rate {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    position: relative;
    display: inline-block;
}

.asterisk {
    font-size: 1.5rem;
    position: absolute;
    top: 10px;
    right: -20px;
    color: rgba(255, 255, 255, 0.6);
}

.cta-button {
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 94, 98, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-body);
    margin-top: 1rem;
}

.cta-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 94, 98, 0.6);
}

.cta-button:active {
    transform: translateY(1px);
}

.cta-button.clicked {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    transform: scale(0.95);
    pointer-events: none;
    /* Prevent double clicks */
    box-shadow: 0 0 15px rgba(56, 239, 125, 0.6);
}

footer {
    position: relative;
    margin-top: 3rem;
    padding-bottom: 2rem;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    z-index: 10;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 2rem;
        margin: 1rem;
    }

    .rate {
        font-size: 3.5rem;
    }
}

/* Form Styles */
.refi-form {
    margin-top: 1rem;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.form-section {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.grow-2 {
    flex-grow: 2;
}

label {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

input,
select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(254, 202, 87, 0.2);
}

select option {
    background-color: #1a1a1a;
    color: white;
}

.disclaimer {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #fff;
    background: rgba(254, 202, 87, 0.1);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
    font-style: italic;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

/* Adjust button for form */
.refi-form .cta-button {
    width: auto;
    min-width: 200px;
    display: block;
    margin: 0 auto;
}

/* Validation Styles */
.error-message {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-weight: 500;
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.input-error {
    border-color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}