/* ================================
   Extras Page Styles - Red Edition v5
   Matching MortgageCO Brand Design System
   ================================ */

/* Using CSS Variables from main styles.css */
:root {
    /* Primary Red Palette - Matching MortgageCO Brand */
    --primary-color: #b5121c;
    --primary-dark: #000000;
    --primary-light: #c93339;
    --accent-color: #b5121c;
    --accent-light: #c93339;
    --accent-dark: #b5121c;
    
    /* Success & Trust Colors */
    --success-color: #b5121c;
    --trust-color: #c93339;
    
    /* Neutral Colors */
    --text-dark: #000000;
    --text-medium: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --background-light: #fafafa;
    --background-cream: #f8f8f8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #b5121c 0%, #c93339 100%);
    --gradient-accent: linear-gradient(135deg, #b5121c 0%, #c93339 100%);
    --gradient-subtle: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(181, 18, 28, 0.08);
    --shadow-md: 0 4px 16px rgba(181, 18, 28, 0.12);
    --shadow-lg: 0 8px 32px rgba(181, 18, 28, 0.16);
    --shadow-xl: 0 16px 48px rgba(181, 18, 28, 0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ================================
   FORM LABELS
   ================================ */

.form-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

/* ================================
   SELECT LABEL OPTIONS - UPDATED
   ================================ */

.aq-select-label-option {
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: 0 4px 20px rgba(181, 18, 28, 0.06);
    transition: all var(--transition-base);
    cursor: pointer;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}

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

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

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

.ant-logo {
    margin-bottom: 1.5rem;
    text-align: center;
}

.ant-logo img {
    max-width: 120px;
    height: auto;
    transition: transform var(--transition-base);
}

.ant-logo img:hover {
    transform: scale(1.05);
}

.ant-logo-modal {
    height: auto;
    width: auto;
    position: relative;
    text-align: center;
}

/* ================================
   HOVER STATES
   ================================ */

.aq-select-label-option:hover {
    background: var(--gradient-primary) !important;
    border: 2px solid var(--primary-color);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(181, 18, 28, 0.15);
}

.aq-select-label-option:hover::before {
    opacity: 1;
}

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

.aq-select-label-option:hover .aq-select-img {
    filter: brightness(0) invert(1);
    transform: scale(1.1);
}

.aq-select-label-option:hover .aq-box-option-title {
    color: var(--white);
}

/* ================================
   RADIO BUTTON STATES
   ================================ */

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

input[type="radio"]:checked + label {
    color: var(--white);
    border-color: var(--primary-color);
    background: var(--gradient-primary);
    box-shadow: 0 8px 32px rgba(181, 18, 28, 0.2);
    transform: scale(1.02);
}

input[type="radio"]:checked + label .aq-box-option-title {
    color: var(--white);
}

input[type="radio"]:checked + label .aq-select-img {
    filter: brightness(0) invert(1);
    transform: scale(1.1);
}

.select-box input[type="radio"]:checked + label .select-img {
    filter: brightness(0) invert(1);
    transform: scale(1.1);
}

/* ================================
   BOX OPTION TITLE
   ================================ */

.aq-box-option-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    transition: color var(--transition-base);
    position: relative;
    z-index: 1;
}

/* ================================
   SELECT IMAGE
   ================================ */

.aq-select-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 0.6rem auto;
    filter: grayscale(20%) brightness(0) saturate(100%);
    opacity: 0.75;
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
}

/* ================================
   MODAL STYLING
   ================================ */

.aq-modal-header {
    border-bottom: 2px solid rgba(181, 18, 28, 0.1);
    padding: 1rem 1.5rem;
    background: var(--gradient-subtle);
}

.modal-question {
    padding-left: 20px;
    padding-right: 20px;
}

/* ================================
   EXTRAS FORM STEPS
   ================================ */

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

.extras-form-wrapper {
    margin: 1rem auto 3rem auto;
    width: 100%;
    padding: 2rem 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(181, 18, 28, 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: #ffbf00;
    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(--success-color);
    max-width: 200px;
    width: 100%;
    margin: 0 auto 3rem;
    background-color: #f5fdf3ff;
    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(--success-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-primary);
    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(181, 18, 28, 0.1);
}

/* ================================
   ADDITIONAL OFFERS
   ================================ */

.ty-additional-offers {
    border: 2px solid rgba(181, 18, 28, 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(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    transition: all var(--transition-slow);
    background: var(--gradient-subtle);
    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-primary);
    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(181, 18, 28, 0.25);
    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(181, 18, 28, 0.35);
}

.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(181, 18, 28, 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(181, 18, 28, 0.05);
}

.user-message {
    background: linear-gradient(135deg, rgba(181, 18, 28, 0.1), rgba(201, 51, 57, 0.1));
    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(181, 18, 28, 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 #e8e8e8;
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
    resize: vertical;
}

#user-textarea:focus {
    box-shadow: 0 0 0 4px rgba(181, 18, 28, 0.1);
    border-color: var(--primary-color);
    outline: none;
}

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

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

.textbox-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(181, 18, 28, 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(--primary-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(--primary-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;
    }
}