/*
  Application Form Styles for Paramount Behavior
  Coherent with existing site design
*/

/* Application Form Container */
.grax_tm_application_form {
    width: 100%;
    min-height: 100vh;
    padding: 150px 0 100px;
    background: #f9f9f9;
}

/* Title styling to prevent overlap */
.grax_tm_application_form .grax_tm_title_holder {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.grax_tm_application_form .grax_tm_title_holder h3 {
    margin-bottom: 15px;
    margin-top: 0;
}

.grax_tm_application_form .grax_tm_title_holder p {
    margin-bottom: 0;
    margin-top: 0;
    color: #666;
    font-size: 16px;
}

/* Fix header menu visibility - Force dark text always */
.grax_tm_topbar .menu ul li a {
    color: #333 !important;
}

.grax_tm_topbar.animate .menu ul li a {
    color: #333 !important;
}

.grax_tm_topbar .menu ul li a:hover,
.grax_tm_topbar .menu ul li.current a {
    color: crimson !important;
}

/* Mobile Menu Fix - Ensure it stays on top and doesn't overlap */
@media (max-width: 1040px) {
    /* Fix mobile menu to stay at top */
    .grax_tm_mobile_menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    /* Ensure mobile menu inner has proper background */
    .grax_tm_mobile_menu .mobile_menu_inner {
        background: white !important;
        position: relative;
        z-index: 10000;
    }

    /* Account for fixed header height (logo + padding + border = ~65px) */
    .grax_tm_application_form {
        padding-top: 85px !important;
    }

    /* Push content below mobile menu */
    body {
        padding-top: 65px;
    }

    /* Ensure dropdown doesn't push content */
    .grax_tm_mobile_menu .dropdown {
        position: absolute !important;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 9998;
    }

    /* When dropdown is open, don't affect page layout */
    .grax_tm_mobile_menu.dropdown_open {
        overflow: visible;
    }
}

.application_wrapper {
    max-width: 800px;
    margin: 50px 20px 0;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    overflow: hidden;
}

/* Progress Bar */
.progress_bar {
    position: relative;
    height: 3px;
    background: #e5e5e5;
    border-radius: 2px;
    margin: 60px 20px 70px 20px;
}

.progress_fill {
    position: absolute;
    height: 100%;
    background: #dc143c;
    border-radius: 2px;
    width: 16.66%;
    transition: width 0.4s ease;
}

.progress_steps {
    display: flex;
    justify-content: space-between;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 20px;
}

.progress_steps .step {
    min-width: 32px;
    width: 32px;
    min-height: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    flex-shrink: 0;
    flex-grow: 0;
}

.progress_steps .step.active {
    background: #dc143c;
    color: #fff;
    font-weight: 600;
}

.progress_steps .step.completed {
    background: #4caf50;
    color: #fff;
}

/* Form Sections */
.form_section {
    display: none;
    animation: fadeIn 0.5s ease;
    margin-top: 20px;
}

.form_section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form_section h4 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

/* Form Groups */
.form_group {
    margin-bottom: 25px;
}

.form_group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
    font-family: 'Mulish', sans-serif;
}

.form_group input[type="text"],
.form_group input[type="email"],
.form_group input[type="tel"],
.form_group input[type="number"],
.form_group select,
.form_group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Mulish', sans-serif;
    transition: all 0.3s ease;
    background: #fff;
}

/* Enhanced Date Input Styles */
.date-input {
    font-family: 'Courier New', monospace !important;
    letter-spacing: 1px;
    font-size: 15px !important;
}

.date-input::placeholder {
    color: #bbb;
    font-family: 'Mulish', sans-serif;
    letter-spacing: normal;
    font-size: 14px;
}

.date-input:focus {
    border-color: #dc143c !important;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1) !important;
}

.date-input.error {
    border-color: #f44336 !important;
    background-color: #ffebee;
}

.error-message {
    display: block;
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form_group input:focus,
.form_group select:focus,
.form_group textarea:focus {
    outline: none;
    border-color: var(--primary-color, crimson);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form_group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form Row */
.form_row {
    display: flex;
    gap: 20px;
    margin-left: -10px;
    margin-right: -10px;
}

.form_group.half {
    flex: 1;
    padding: 0 10px;
}

.form_group.third {
    flex: 0 0 31%;
    padding: 0 10px;
}

/* Radio & Checkbox Styling */
.radio_group,
.checkbox_group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.radio_container,
.checkbox_container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
    padding: 5px 0;
}

.radio_container input,
.checkbox_container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio_mark,
.checkbox_mark {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #ddd;
    position: relative;
    transition: all 0.3s ease;
}

.radio_mark {
    border-radius: 50%;
}

.checkbox_mark {
    border-radius: 3px;
}

.radio_container input:checked ~ .radio_mark,
.checkbox_container input:checked ~ .checkbox_mark {
    background: var(--primary-color, crimson);
    border-color: var(--primary-color, crimson);
}

.radio_mark:after,
.checkbox_mark:after {
    content: "";
    position: absolute;
    display: none;
}

.radio_container input:checked ~ .radio_mark:after {
    display: block;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox_container input:checked ~ .checkbox_mark:after {
    display: block;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Large Checkbox for Consent */
.checkbox_container.large {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 10px;
}

.consent_text {
    flex: 1;
    line-height: 1.5;
}

/* File Upload */
.file_upload {
    position: relative;
}

.file_upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file_label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file_label:hover {
    border-color: var(--primary-color, crimson);
    background: #fff;
}

.file_upload input[type="file"]:focus + .file_label {
    border-color: var(--primary-color, crimson);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.file_icon {
    font-size: 30px;
    margin-right: 10px;
}

.file_text {
    font-size: 14px;
    color: #666;
}

/* Conditional Fields */
.conditional_field {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color, crimson);
}

/* Reference Blocks */
.reference_block {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 20px;
}

.reference_block h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.reference_block input {
    margin-bottom: 10px;
}

/* Field Description */
.field_description {
    font-size: 12px;
    color: #888;
    margin: 5px 0 10px;
    font-style: italic;
}

/* Form Navigation */
.form_navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form_navigation.final {
    justify-content: space-between;
}

.btn_prev,
.btn_next,
.btn_submit {
    padding: 12px 35px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn_prev {
    background: #f0f0f0;
    color: #666;
    border: none;
}

.btn_prev:hover {
    background: #e0e0e0;
}

.btn_next,
.btn_submit {
    background: var(--primary-color, crimson);
    color: #fff;
    border: none;
}

.btn_next:hover,
.btn_submit:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.3);
}

.btn_submit {
    background: #4caf50;
}

.btn_submit:hover {
    background: #45a049;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

/* Success Message */
.success_message {
    text-align: center;
    padding: 60px 20px;
}

.success_icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success_message h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.success_message p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn_home {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 35px;
    background: var(--primary-color, crimson);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn_home:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

/* Consent Section */
.consent_section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-top: 30px;
}

.consent_section h5 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

/* Error States */
.form_group.error input,
.form_group.error select,
.form_group.error textarea {
    border-color: #f44336;
}

.error_message {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form_group.error .error_message {
    display: block;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color, crimson);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tablet Responsive Design */
@media (max-width: 768px) {
    /* Maintain consistent padding from larger breakpoint */
    .grax_tm_application_form {
        padding-top: 85px !important;
        padding-bottom: 60px;
    }

    .grax_tm_application_form .grax_tm_title_holder {
        margin-bottom: 30px;
        padding: 0 15px;
    }

    .grax_tm_application_form .grax_tm_title_holder h3 {
        font-size: 24px;
        letter-spacing: 3px;
        line-height: 1.3;
    }

    .grax_tm_application_form .grax_tm_title_holder p {
        font-size: 14px;
    }

    .application_wrapper {
        padding: 30px 20px;
        margin: 20px 15px 0;
        margin-left: auto;
        margin-right: auto;
    }

    .progress_bar {
        margin: 40px 10px 50px 10px;
    }

    .progress_steps {
        padding: 0 10px;
    }

    .progress_steps .step {
        min-width: 28px;
        width: 28px;
        min-height: 28px;
        height: 28px;
        font-size: 12px;
    }

    .grax_tm_footer_wrap .footer_inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .grax_tm_footer_wrap .social ul {
        justify-content: center;
    }

    .form_row {
        flex-direction: column;
    }

    .form_group.half,
    .form_group.third {
        flex: 1 0 100%;
        padding: 0;
    }

    .radio_group,
    .checkbox_group {
        flex-direction: column;
    }

    .form_navigation {
        flex-direction: column;
        gap: 10px;
    }

    .btn_prev,
    .btn_next,
    .btn_submit {
        width: 100%;
    }

    .progress_steps .step {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Small Mobile Responsive Design */
@media (max-width: 480px) {
    /* Keep consistent padding-top to prevent jumping */
    .grax_tm_application_form {
        padding: 85px 0 60px !important;
    }

    .grax_tm_application_form .grax_tm_title_holder {
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .grax_tm_application_form .grax_tm_title_holder h3 {
        font-size: 20px;
        letter-spacing: 1px;
        margin-bottom: 10px;
        line-height: 1.2;
    }

    .grax_tm_application_form .grax_tm_title_holder p {
        font-size: 13px;
        line-height: 1.4;
    }

    .form_section h4 {
        font-size: 20px;
    }

    .application_wrapper {
        padding: 20px 15px;
        margin: 15px 10px 0;
        border-radius: 8px;
    }

    /* Ensure progress bar fits on small screens */
    .progress_steps .step {
        min-width: 25px;
        width: 25px;
        min-height: 25px;
        height: 25px;
        font-size: 11px;
    }
}

/* Footer Styles */
.grax_tm_footer_wrap {
    width: 100%;
    padding: 40px 0;
    background: #111;
    margin-top: 80px;
}

.grax_tm_footer_wrap .footer_inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grax_tm_footer_wrap .copy p {
    color: #fff;
    font-size: 14px;
    margin: 0;
    letter-spacing: 0.5px;
}

.grax_tm_footer_wrap .social ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 20px;
}

.grax_tm_footer_wrap .social ul li {
    margin: 0;
}

.grax_tm_footer_wrap .social .svg {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.grax_tm_footer_wrap .social a:hover .svg {
    filter: brightness(0) invert(1) opacity(0.7);
}

/* Dark Mode Support */
body.dark .grax_tm_application_form {
    background: #1a1a1a;
}

body.dark .application_wrapper {
    background: #2a2a2a;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

body.dark .form_section h4 {
    color: #fff;
}

body.dark .form_group label {
    color: #ccc;
}

body.dark .form_group input,
body.dark .form_group select,
body.dark .form_group textarea {
    background: #333;
    border-color: #444;
    color: #fff;
}

body.dark .radio_container,
body.dark .checkbox_container {
    color: #ccc;
}

body.dark .file_label {
    background: #333;
    border-color: #444;
}

body.dark .file_text {
    color: #aaa;
}

body.dark .conditional_field,
body.dark .reference_block,
body.dark .consent_section {
    background: #333;
}

body.dark .success_message h3 {
    color: #fff;
}

body.dark .success_message p {
    color: #ccc;
}
