/* =========================================================================
   Stratedgy Careers - application form styles (job pages only)
   1. The site's shared form styles, scoped to job pages so the form looks
      the same even if the site-wide Additional CSS changes later.
   2. Styles for section titles, questions, choices, word counters.
   3. The approved tweaks from the Creative Operator page.
   ========================================================================= */

/* Main Form Container */
.sgc-job .cf7-strat-app-form-wrapper {
    background-color: #fff;
}

/* Input & Textarea Base Styles */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-text-input,
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    font-family: 'Grafical', sans-serif !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    line-height: 60px !important;
    padding: 0 !important;
    color: #333 !important;
}

/* Placeholder Styles */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-text-input::placeholder,
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field::placeholder {
    color: #DBDBDB !important;
    font-family: 'Grafical', sans-serif !important;
    font-size: 30px !important;
    font-style: normal !important;
    font-weight: 300 !important;
    line-height: 60px !important;
    opacity: 1 !important;
}

/* Textarea Specific */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field {
    resize: none !important;
    min-height: 100px !important;
    line-height: 80px !important;
}

.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field::placeholder {
    line-height: 80px !important;
}

/* Lined Textarea Styles - OPTIMIZED */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-lined-textarea-container .cf7-strat-app-textarea-field {
    background-image: 
        linear-gradient(to bottom, #fff 0px, #fff 10px, transparent 10px),
        linear-gradient(to bottom, transparent 79px, #000 79px, #000 80px) !important;
    background-size: 100% 5px, 100% 80px !important;
    background-repeat: no-repeat, repeat-y !important;
    background-position: 0 0, 0 0 !important;
    background-attachment: scroll, local !important;
    line-height: 80px !important;
    min-height: 160px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-top: none !important;
    box-shadow: none !important;
}

.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-lined-textarea-container .cf7-strat-app-textarea-field::placeholder {
    line-height: 80px !important;
}

/* File Upload Input */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-file-upload-input {
    width: 0.1px !important;
    height: 0.1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    z-index: -1 !important;
}

/* Upload Button Label */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-btn-label {
    background-color: #FFB000 !important;
    color: #fff !important;
    font-family: 'Grafical', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 10px 20px !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    display: inline-block !important;
    transition: opacity 0.3s ease !important;
}

.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-btn-label:hover {
    opacity: 0.9 !important;
}

/* Submit Button Wrapper */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn-wrapper {
    text-align: right !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn-wrapper p {
    margin: 0 !important;
    padding: 0 !important;
    text-align: right !important;
}

/* Submit Button */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn {
    background-color: #1E2223 !important;
    color: #fff !important;
    font-family: 'Grafical', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    padding: 15px 50px !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    margin: 0 !important;
    float: right !important;
    transition: opacity 0.3s ease !important;
}

.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn:hover {
    opacity: 0.9 !important;
}

/* CF7 Form Control Wrap */
.sgc-job .cf7-strat-app-form-wrapper .wpcf7-form-control-wrap {
    display: block !important;
    width: 100% !important;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */
@media screen and (max-width: 768px) {
    .sgc-job .cf7-strat-app-form-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-flex-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-flex-row .cf7-strat-app-half-width-col {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 15px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-text-input,
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field {
        font-size: 16px !important;
        line-height: 40px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-text-input::placeholder,
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field::placeholder {
        font-size: 16px !important;
        line-height: 40px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-required-asterisk {
        font-size: 20px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-label-text {
        font-size: 16px !important;
        line-height: 40px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-btn-label {
        font-size: 12px !important;
        padding: 8px 15px !important;
    }
    
    /* Lined Textarea Mobile Styles - OPTIMIZED */
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-lined-textarea-container .cf7-strat-app-textarea-field {
        background-image: linear-gradient(to bottom, transparent 49px, #000 49px, #000 50px) !important;
    background-size: 100% 50px !important;
    background-repeat: repeat-y !important;
    background-position: 0 0 !important;
    background-attachment: local !important;
    line-height: 50px !important;
    min-height: 150px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-lined-textarea-container .cf7-strat-app-textarea-field::placeholder {
        line-height: 50px !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn {
        font-size: 16px !important;
        padding: 12px 40px !important;
        float: right !important;
        margin: 0 !important;
    }
    
    .sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-submit-btn-wrapper {
        text-align: right !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }
}

/* Validation Error Styling */
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-field-container .wpcf7-not-valid-tip {
    position: absolute !important;
    right: 120px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 14px !important;
    color: #d00 !important;
    white-space: nowrap !important;
}

/* Additional CF7 Validation Styles */
.sgc-job .cf7-strat-app-form-wrapper .wpcf7-not-valid {
    border-color: #d00 !important;
}

.sgc-job .cf7-strat-app-form-wrapper .wpcf7-response-output {
    margin: 20px 0 !important;
    padding: 15px !important;
    border: 2px solid #d00 !important;
    font-family: 'Grafical', sans-serif !important;
}

.sgc-job .cf7-strat-app-form-wrapper .wpcf7-validation-errors {
    border-color: #d00 !important;
    color: #d00 !important;
}

/* Wrapper: the shared inline max-width:100vh squeezes the form on short landscape
   phones (769-880px wide, ~400px tall). Desktop keeps the shared 100vh cap. */
@media screen and (max-width: 880px) {
    .cf7-strat-app-form-wrapper.cf7-co-form {
        max-width: 100% !important;
    }
}

/* Section titles (Basic Details / Education & Work Experience / Your Intent) */
.cf7-co-form .cf7-co-section-title {
    font-family: 'Grafical', sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 36px;
    color: #1E2223;
    margin: 50px 0 10px 0;
    padding: 0 0 0 12px;
    border-left: 2px solid #FFB000;
}
.cf7-co-form .cf7-co-section-title:first-child {
    margin-top: 0;
}

/* Question text shown above a field */
.cf7-co-form .cf7-co-question {
    font-family: 'Grafical', sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 30px;
    color: #333;
    margin: 20px 0 12px 0;
    padding: 0;
    display: block;
    cursor: default;
}
.cf7-co-form .cf7-co-question--standalone {
    margin-top: 30px;
    margin-bottom: 0;
}
.cf7-co-form .cf7-co-required {
    color: #DBDBDB;
    font-weight: 300;
}

/* Radio + checkbox groups */
.cf7-co-form .wpcf7-form-control.cf7-co-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 36px;
}
/* Checkbox group: a grid, so the boxes line up in straight columns */
.cf7-co-form .wpcf7-form-control.wpcf7-checkbox.cf7-co-choice {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px 36px;
}
.cf7-co-form .cf7-co-choice .wpcf7-list-item {
    margin: 0;
    display: block;
    min-width: 0;
}
.cf7-co-form .cf7-co-choice label {
    display: inline-flex;
    align-items: flex-start;               /* box sits on the first line if a label wraps */
    gap: 12px;
    margin: 0;
    cursor: pointer;
    font-family: 'Grafical', sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 28px;
    color: #333;
}
.cf7-co-form .cf7-co-choice input[type="radio"],
.cf7-co-form .cf7-co-choice input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 4px 0 0 0;                     /* centred on the first 28px text line */
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.cf7-co-form .cf7-co-choice input[type="radio"] {
    border-radius: 50%;
}
.cf7-co-form .cf7-co-choice input:checked {
    background-color: #FFB000;
    border-color: #FFB000;
}
.cf7-co-form .cf7-co-choice input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.cf7-co-form .cf7-co-choice input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}
.cf7-co-form .cf7-co-choice input:focus-visible {
    outline: 2px solid #1E2223;
    outline-offset: 2px;
}

/* Validation tips inside the new containers sit below the field */
.cf7-co-form .cf7-co-question-container .wpcf7-not-valid-tip,
.cf7-co-form .cf7-strat-app-lined-textarea-container .wpcf7-not-valid-tip {
    display: block;
    font-size: 14px;
    margin-top: 8px;
}

/* Upload row: show the chosen file name */
.cf7-co-form .cf7-strat-app-upload-label-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 15px;
}
.cf7-co-form .cf7-strat-app-upload-label-text.cf7-co-has-file {
    color: #333 !important;
}

/* Word counter under the 50-word answers */
.cf7-co-form .cf7-co-word-count {
    display: block;
    text-align: right;
    font-family: 'Grafical', sans-serif;
    font-size: 13px;
    line-height: 20px;
    color: #9A9A9A;
    margin-top: 6px;
}
.cf7-co-form .cf7-co-word-count.cf7-co-over {
    color: #d00;
}

/* Narrow tablet column (769-1024px): stack Email / Phone like the shared mobile
   rule does, so "Email address" and "Phone number" keep the shared 30px size. */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .cf7-co-form .cf7-strat-app-flex-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .cf7-co-form .cf7-strat-app-flex-row .cf7-strat-app-half-width-col {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 15px !important;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .cf7-co-form .cf7-co-section-title {
        font-size: 18px;
        line-height: 26px;
        margin-top: 35px;
    }
    .cf7-co-form .cf7-co-question {
        font-size: 15px;
        line-height: 22px;
    }
    .cf7-co-form .cf7-co-question--standalone {
        margin-top: 22px;
    }
    .cf7-co-form .cf7-co-choice label {
        font-size: 15px;
        line-height: 22px;
        gap: 10px;
    }
    .cf7-co-form .wpcf7-form-control.cf7-co-choice {
        gap: 12px 24px;
    }
    /* Checkboxes: two equal columns on larger phones / small tablets */
    .cf7-co-form .wpcf7-form-control.wpcf7-checkbox.cf7-co-choice {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 24px;
    }
    .cf7-co-form .cf7-co-choice input[type="radio"],
    .cf7-co-form .cf7-co-choice input[type="checkbox"] {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
        margin-top: 2px;                   /* centred on the first 22px text line */
    }
    .cf7-co-form .cf7-co-choice input[type="checkbox"]:checked::after {
        left: 5px;
        top: 1px;
    }
    .cf7-co-form .cf7-co-choice input[type="radio"]:checked::after {
        left: 4px;
        top: 4px;
    }
}

/* Phones: one checkbox per line, all boxes in one straight column */
@media screen and (max-width: 480px) {
    .cf7-co-form .wpcf7-form-control.wpcf7-checkbox.cf7-co-choice {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

/* ---------- Approved tweaks (thank-you message, placeholders, spinner) ---------- */
.sgc-job .wpcf7 form .wpcf7-response-output {
    font-family: 'Grafical', sans-serif !important;
    font-weight: 300 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #1E2223 !important;
    margin: 30px 0 0 0 !important;
    padding: 15px 20px !important;
}
.sgc-job .wpcf7 form.sent .wpcf7-response-output {
    border: 2px solid #000 !important;
}
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-text-input::placeholder,
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-textarea-field::placeholder {
    color: #B5B5B5 !important;
    opacity: 1 !important;
}
.sgc-job .cf7-strat-app-form-wrapper .cf7-strat-app-upload-label-text:not(.cf7-co-has-file) {
    color: #B5B5B5 !important;
}
.sgc-job .wpcf7-spinner {
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* "Show label: hidden" - keep the label for screen readers only */
.sgc-job .cf7-co-form .sgc-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
/* Long answer with the label inside: leave room for the required asterisk */
.sgc-job .cf7-co-form .sgc-label-inside .cf7-strat-app-textarea-field,
.sgc-job .cf7-co-form .sgc-label-hidden .cf7-strat-app-textarea-field {
    padding-right: 28px;
}
@media screen and (max-width: 768px) {
    .sgc-job .cf7-co-form .sgc-label-inside > .cf7-strat-app-required-asterisk,
    .sgc-job .cf7-co-form .sgc-label-hidden > .cf7-strat-app-required-asterisk {
        top: 25px !important;
    }
}
