/* ================================
   Extras Page Styles - Matching Main Site
   ================================ */

/* Using CSS Variables from main styles.css */
:root {
    --primary-color: #161928;
    --primary-dark: #0d0f18;
    --primary-light: #1f2337;
    --accent-color: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #2563eb;
    --success-color: #10b981;
    --text-dark: #161928;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --white: #ffffff;
    --background-light: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #161928 0%, #1f2337 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ================================
   FORM LABELS - Matching Main Site
   ================================ */

.form-label {
    font-weight: 600;
    color: #161928;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: block;
}

/* ================================
   QUESTIONS/HEADINGS - Matching Main Site Bold Style
   ================================ */

.extras-form-steps legend.questions,
.extras-form-steps h3 {
    color: #161928;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 992px) {
    .extras-form-steps legend.questions,
    .extras-form-steps h3 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 767px) {
    .extras-form-steps legend.questions,
    .extras-form-steps h3 {
        font-size: 1.35rem;
        line-height: 1.3;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .extras-form-steps legend.questions,
    .extras-form-steps h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* ================================
   SELECT BOXES - Matching Main Site
   ================================ */

.select-box {
    cursor: pointer;
    transition: all var(--transition-base);
    height: 100%;
    margin-bottom: 1rem;
}

.select-label-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.875rem;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    cursor: pointer;
    height: 100%;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}

/* Override Bootstrap for select boxes */
.select-label-option.form-label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.select-label-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.select-label-option::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.select-box:hover .select-label-option,
.select-label-option.clickable:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.select-box:hover .select-label-option::before {
    opacity: 0.06;
}

.select-box:hover .select-label-option::after {
    transform: scaleX(1);
}

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

.select-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    margin-left: auto !important;
    margin-right: auto !important;
    filter: grayscale(0%) brightness(0) saturate(100%);
    opacity: 0.85;
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
}

.select-box:hover .select-img {
    filter: grayscale(0%) brightness(100%);
    opacity: 1;
    transform: scale(1.15);
}

.box-option-title {
    font-size: 1rem;
    font-weight: 800;
    color: #161928;
    text-align: center !important;
    width: 100% !important;
    position: relative;
    z-index: 1;
    transition: color var(--transition-base);
    letter-spacing: -0.01em;
}

.box-option-title small {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    margin-top: 0.25rem;
}

.select-box:hover .box-option-title {
    color: var(--primary-color);
}

/* Row spacing */
.section-main .row.justify-content-center {
    row-gap: 1rem;
}

/* Mobile responsiveness for select boxes */
@media (max-width: 767px) {
    .select-box {
        padding: 0.875rem 0.75rem;
        min-height: 90px;
    }

    .select-img {
        max-width: 40px;
        max-height: 40px;
    }

    .box-option-title {
        font-size: 0.9rem;
    }

    .box-option-title small {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .select-box {
        min-height: 80px;
        padding: 0.75rem 0.625rem;
    }

    .box-option-title {
        font-size: 0.85rem;
    }
}

/* ================================
   LOGO STYLING
   ================================ */

.extras-form-steps {
    display: none;
    position: relative;
}

.extras-form-wrapper {
    margin: 1rem auto 1.5rem auto;
    width: 100%;
    padding: 2rem 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(0, 0, 0, 0.08);
}

/* ================================
   EXTRA BOX ON TOP
   ================================ */

.extra-box-on-top {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1.5rem 1.5rem;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    position: relative;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ================================
   ARROW ANIMATION
   ================================ */

.arrow-down {
    position: absolute;
    bottom: -70px;
    right: -75px;
    width: 90px;
    z-index: 999;
    -webkit-animation: downarrow 0.6s infinite alternate ease-in-out;
    animation: downarrow 0.6s infinite alternate ease-in-out;
}

@-webkit-keyframes downarrow {
    0% { 
        -webkit-transform: translateY(0); 
        transform: translateY(0);
        opacity: 1;
    }
    100% { 
        -webkit-transform: translateY(0.5em); 
        transform: translateY(0.5em);
        opacity: 1;
    }
}

@keyframes downarrow {
    0% { 
        transform: translateY(0);
        opacity: 1;
    }
    100% { 
        transform: translateY(0.5em);
        opacity: 1;
    }
}

.view-new-mortgage-top {
    color: #fbbf24;
    position: relative;
    font-weight: 800;
    text-decoration: none;
}

/* ================================
   TABLET STYLES
   ================================ */

@media (min-width: 768px) {
    .extras-form-wrapper {
        margin: 1rem auto 3rem auto;
        width: 100%;
        padding: 2.5rem 2rem;
        border-radius: var(--radius-lg);
        overflow: hidden;
        position: relative;
    }

    .aq-form-label {
        font-size: 18px;
    }

    .aq-select-label-option {
        padding: 1.5rem 1.25rem;
    }

    .aq-select-img {
        width: 80px;
        height: 80px;
        margin: 1rem auto;
    }

    .ant-logo img {
        max-width: 160px;
    }
}

/* ================================
   THANK YOU PAGE STYLES
   ================================ */

#chart-ty {
    margin-top: -75px;
}

@media (min-width: 992px) {
    #chart-ty {
        margin-top: -92px;
    }
}

.amount-box {
    padding: 18px 10px;
    border-radius: var(--radius-md);
    border: 4px solid var(--accent-color);
    max-width: 200px;
    width: 100%;
    margin: 0 auto 3rem;
    background-color: #ffffff;
    position: relative;
    text-align: right;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 992px) {
    .amount-box {
        padding: 30px 15px;
        max-width: 280px;
        width: 100%;
        margin: 0 auto 3rem;
        position: relative;
        text-align: right;
    }
}

.amount-box:before {
    content: '$';
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-color);
    position: absolute;
    left: 10px;
    top: 11px;
}

@media (min-width: 992px) {
    .amount-box:before {
        content: '$';
        font-size: 42px;
        left: 10px;
        top: 25px;
        z-index: 99;
    }
}

.amount-box-text {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--text-dark);
}

@media (min-width: 992px) {
    .amount-box-text {
        font-size: 46px;
        font-weight: 900;
        line-height: 1.2;
        color: var(--text-dark);
        z-index: 999;
        position: relative;
    }
}

/* ================================
   STEP BADGES
   ================================ */

.step-ty {
    background: var(--gradient-accent);
    color: var(--white);
    border-radius: 100%;
    height: 60px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .step-ty {
        height: 80px;
        width: 80px;
    }
}

.step-ty-text {
    font-size: 11px;
    line-height: 1.4;
    font-weight: 600;
}

@media (min-width: 768px) {
    .step-ty-text {
        font-size: 14px;
        line-height: 1.4;
    }
}

.step-ty-number {
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
}

@media (min-width: 768px) {
    .step-ty-number {
        font-size: 34px;
        line-height: 1;
    }
}

.step-ty-description {
    background-color: var(--background-light);
    padding: 1.5rem;
    font-weight: 500;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ================================
   BUTTONS - Matching Main Site
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.back-btn {
    background: var(--white);
    color: #161928;
    border: 2px solid #e0e0e0;
    box-shadow: var(--shadow-sm);
}

.back-btn:hover {
    background: #fafafa;
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(-4px);
}

.next-btn,
.submit-btn,
.btn-primary {
    background: var(--gradient-accent);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.next-btn::before,
.submit-btn::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.next-btn:hover::before,
.submit-btn:hover::before,
.btn-primary:hover::before {
    left: 100%;
}

.next-btn:hover,
.submit-btn:hover:not(:disabled),
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.btn.invisible {
    visibility: hidden;
}

.icon-forward,
.icon-back {
    width: 1em;
    height: 1em;
}

/* Navigation Buttons */
.form-nav-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: space-between;
}

/* Mobile button styles */
@media (max-width: 992px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .form-nav-buttons {
        gap: 0.75rem;
    }
}

@media (max-width: 767px) {
    .form-nav-buttons {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        padding: 0.85rem 1.75rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    .back-btn {
        flex: 0 0 auto;
        min-width: 90px;
    }

    .next-btn, .submit-btn {
        flex: 1;
        min-width: 120px;
    }

    .icon-forward, .icon-back {
        width: 0.9em;
        height: 0.9em;
    }
}

@media (max-width: 480px) {
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

.ty-additional-offers {
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .ty-additional-offers {
        padding: 2.5rem 2rem;
    }
}

.ty-offer-container {
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    transition: all var(--transition-slow);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(96, 165, 250, 0.05) 100%);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .ty-offer-container {
        padding: 2rem;
    }
}

.ty-offer-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* ================================
   CUSTOM MAX-WIDTHS
   ================================ */

.custom-mw-921 {
    max-width: 921px;
    margin-left: auto;
    margin-right: auto;
}

.custom-mw-720 {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   OFFER BUTTON
   ================================ */

.ty-offer-button {
    color: var(--white);
    background: var(--gradient-accent);
    font-weight: 700;
    width: 100%;
    max-width: 190px;
    transition: all var(--transition-slow);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.ty-offer-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ty-offer-button:hover {
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ty-offer-button:hover::before {
    width: 300px;
    height: 300px;
}

/* ================================
   CHAT BOX
   ================================ */

.chat-box {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    padding-bottom: 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.chat-box-heading {
    padding: 1.5rem 2rem;
    background: var(--gradient-primary);
    color: var(--white);
}

.chat-box-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.chat-box-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

.chat-box-date {
    text-align: center;
    padding: 1rem;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-box-body {
    padding: 1.5rem 2rem;
}

/* ================================
   CHAT MESSAGES
   ================================ */

.agent-message {
    background: var(--background-light);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border-top-left-radius: 0;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    max-width: 620px;
    width: auto;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-message {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(96, 165, 250, 0.15) 100%);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border-top-right-radius: 0;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    max-width: 620px;
    width: auto;
    display: block;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.chat-box-agent-reply {
    display: flex;
    align-items: flex-start;
}

.agent-profile {
    margin-right: 1rem;
    flex-shrink: 0;
}

.chat-box-user-reply {
    display: flex;
    justify-content: flex-end;
    display: none;
}

.user-reply {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* ================================
   TEXTAREA & FORM
   ================================ */

#user-textarea {
    width: 100%;
    padding: 1.5rem 3.5rem 1.5rem 1rem;
    height: 100%;
    border-radius: var(--radius-md);
    min-height: 78px;
    border: 2px solid #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
    resize: vertical;
}

#user-textarea:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
    outline: none;
}

.textarea-wrapper {
    margin-top: 1.5rem;
    padding: 0;
}

.textbox-form {
    position: relative;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.textbox-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#user-send {
    position: absolute;
    border: none;
    background-color: transparent;
    padding: 0 0 0 15px;
    top: 16px;
    right: 10px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.send-btn-icon {
    color: var(--accent-color);
    transition: all var(--transition-base);
}

#user-textarea:focus::placeholder {
    color: transparent;
}

#user-send:hover .send-btn-icon {
    color: var(--primary-dark);
    transform: scale(1.1);
}

/* ================================
   SCROLLBAR STYLING
   ================================ */

#user-textarea::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    background-color: var(--white);
}

#user-textarea::-webkit-scrollbar {
    width: 6px;
    background-color: var(--background-light);
}

#user-textarea::-webkit-scrollbar-thumb {
    border-radius: var(--radius-sm);
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
    background-color: #cacaca;
}

#user-textarea::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
}

/* ================================
   DARK BACKGROUND
   ================================ */

.dark-bg {
    background: var(--gradient-primary);
    color: var(--white);
}

/* ================================
   RESPONSIVE STYLES
   ================================ */

@media (max-width: 767px) {
    .extra-box-on-top {
        padding: 1.25rem 1rem;
        font-size: 0.95rem;
    }
    
    .extras-form-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .chat-box-heading {
        padding: 1.25rem 1.5rem;
    }
    
    .chat-box-body {
        padding: 1rem 1.5rem;
    }
    
    .agent-message,
    .user-message {
        padding: 1rem 1.25rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .aq-select-img {
        width: 48px;
        height: 48px;
    }
    
    .aq-box-option-title {
        font-size: 14px;
    }
    
    .arrow-down {
        width: 70px;
        bottom: -60px;
        right: -60px;
    }
}
/* ================================
   FIX EXCESSIVE SCROLLING PAST FOOTER
   ================================ */

/* Ensure body doesn't allow scrolling past content */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content should grow to fill space */
main,
.section-main {
    flex: 1 0 auto;
    padding-bottom: 1rem;
}

/* Footer stays at bottom without extra space */
footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Remove excessive margins/padding that cause extra scroll */
.container,
.container-fluid {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Ensure no element has huge bottom margins */
.extras-form-wrapper {
    margin-bottom: 1.5rem !important;
}

.form-nav-buttons {
    margin-bottom: 1rem !important;
}