/* ============================================================
   HYPHENATE — Application Form
   Inspired by Accenture career pages — clean, spacious, readable

   Fonts are loaded via <link> in each template. An @import here would
   block rendering a second time, which is expensive on mobile.
   ============================================================ */

:root {
    /* Tells the browser to draw native UI — date pickers, select popups,
       scrollbars, form autofill — in dark. Without it iOS/Android render a
       white picker over this dark page. */
    color-scheme: dark;

    --bg: #1b1b21;
    --bg-card: #39393f;
    --bg-hover: #45454d;
    --gold: #F8D353;
    --gold-soft: #FBE38A;
    --gold-deep: #D4AD2B;
    --white: #ffffff;
    --text: #e8e8f0;
    --text-secondary: #a0a0b8;
    --danger: #f06060;
    --border: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(248, 211, 83, 0.25);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;   /* stop Safari inflating text in landscape */
    text-size-adjust: 100%;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    min-height: 100svh;               /* modern mobile viewport, with fallback above */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Logo --- */
.brand {
    display: inline-flex;
    align-items: baseline;
    font-family: 'Archivo', sans-serif;
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
    color: var(--white);
    letter-spacing: .015em;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none;
}
.brand .txt { font-size: 1em; }
.brand-sm { font-size: 24px; }
.glyph { display: inline-block; position: relative; height: .72em; vertical-align: baseline; }
.glyph i { position: absolute; background: currentColor; border-radius: .5px; }
.glyph i.gold { background: var(--gold); }
.g-h { width: .66em; margin-right: .055em; }
.g-h .s1 { left: 0; bottom: 0; width: .145em; height: 100%; }
.g-h .bar { left: 0; top: 41%; width: 100%; height: .145em; }
.g-h .s2 { right: 0; bottom: 0; width: .145em; height: 59%; }
.g-h .dot { right: 0; top: 0; width: .145em; height: .155em; }
.g-e { width: .60em; margin: 0 .055em; }
.g-e i { left: 0; width: 100%; height: .15em; }
.g-e .t { top: 0; }
.g-e .m { top: 42.5%; }
.g-e .b { bottom: 0; }

/* --- Header --- */
.form-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px clamp(20px, 5vw, 64px);
    padding-left: max(clamp(20px, 5vw, 64px), env(safe-area-inset-left));
    padding-right: max(clamp(20px, 5vw, 64px), env(safe-area-inset-right));
    border-bottom: 1px solid var(--border);
    position: relative;
}

.form-header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2.5vw, 24px);
    letter-spacing: 0.02em;
    color: var(--white);
    white-space: nowrap;
}

/* --- Form container --- */
.form-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px clamp(20px, 5vw, 40px) 80px;
    padding-left: max(clamp(20px, 5vw, 40px), env(safe-area-inset-left));
    padding-right: max(clamp(20px, 5vw, 40px), env(safe-area-inset-right));
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* --- Error banner --- */
.form-error {
    font-size: 15px;
    font-weight: 500;
    color: var(--white);
    padding: 16px 20px;
    background: rgba(240, 96, 96, 0.10);
    border-left: 3px solid var(--danger);
    border-radius: 0 4px 4px 0;
    margin-bottom: 24px;
}

.form-error-note {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- Per-field validation messages ---
   The native validation bubble is the browser's own popup: it disappears on
   the next tap, several Android/tablet builds never paint it at all, and none
   of them explain *why* a date is refused. form.js suppresses it (the only way
   is preventDefault() on the `invalid` event) and writes the reason here
   instead, in the page, where it stays until the answer is fixed. */
.field-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--danger);
}

.field-error::before {
    content: "\26A0";               /* ⚠ — text presentation, not the emoji */
    flex: none;
    font-size: 15px;
    line-height: 1.35;
}

.field-error[hidden] {
    display: none;
}

/* The CV's message is the one that sits directly in the form rather than
   inside a .field, so it has no wrapper margin to sit in — without this it
   touches the submit button. */
.upload-zone + .field-error {
    margin-bottom: 24px;
}

/* --- Position indicator --- */
.applying-for {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--gold);
    padding: 16px 20px;
    background: rgba(248, 211, 83, 0.06);
    border-left: 3px solid var(--gold);
    margin-bottom: 40px;
}

.applying-for strong {
    color: var(--white);
    font-weight: 600;
}

/* --- Section titles --- */
.section-title {
    font-family: 'Archivo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
    margin-top: 40px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-title::before {
    display: none;
}

.section-title:first-of-type {
    margin-top: 0;
}

/* --- Field layout --- */
.field-row {
    display: flex;
    gap: 20px;
}

.field {
    flex: 1;
    min-width: 0;          /* let flex children shrink instead of overflowing */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.field[hidden] {
    display: none;         /* `hidden` alone loses to `display:flex` */
}

.field label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.required {
    color: var(--danger);
    font-weight: 600;
}

/* --- Inputs ---
   16px is the threshold below which iOS Safari zooms the page on focus and
   never zooms back out. Everything the user types into must stay at 16px. */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="date"],
.field select {
    width: 100%;
    min-height: 48px;                 /* comfortable touch target */
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-appearance: none;         /* iOS otherwise imposes its own chrome */
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(248, 211, 83, 0.1);
}

.field input:focus-visible,
.field select:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.field input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* iOS renders date inputs as inline text that ignores the box height and
   left-aligns oddly; these three lines bring them back in line with the rest.

   `appearance: auto` is deliberate and undoes the shared rule above for this
   one type. `appearance: none` on a date input is the documented way to REMOVE
   the calendar button — Chromium drops the picker indicator and Firefox drops
   its calendar button — which is exactly the "no little calendar on tablet"
   bug. The box styling (background, border, padding, 16px text) survives
   `auto` in every engine; only the picker affordance comes back. */
.field input[type="date"] {
    display: block;
    min-height: 48px;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: auto;
    appearance: auto;
}

/* iOS/iPadOS WebKit only — `-webkit-touch-callout` exists nowhere else. There
   the native chrome really does need stripping, and nothing is lost with it:
   tapping anywhere on the field opens the wheel picker, there is no icon. */
@supports (-webkit-touch-callout: none) {
    .field input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }
}

.field input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    min-height: 22px;
}

/* Kept visible and given a 24px box: the default indicator is a ~12px glyph,
   well under the 44px touch target the rest of the form respects. */
.field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
    opacity: 1;
    width: 24px;
    height: 24px;
    padding: 4px;
    margin-left: 4px;
}

/* --- Select --- */
.field select {
    cursor: pointer;
    padding-right: 44px;              /* room for the chevron */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.field select option {
    background: var(--bg-card);
    color: var(--white);
}

/* --- Invalid state ---
   Deliberately declared *after* every input, select and :focus rule above:
   `.field.has-error input` and `.field input[type="text"]` have the same
   specificity, so source order is the only thing that decides. Moved up into
   the .field-error block, these do nothing at all. */
.field.has-error input,
.field.has-error select,
.field.has-error input:focus,
.field.has-error select:focus {
    border-color: var(--danger);
    background-color: rgba(240, 96, 96, 0.06);
    box-shadow: 0 0 0 3px rgba(240, 96, 96, 0.12);
}

/* The radio rows and the consent checkboxes have no box of their own to tint,
   so the block they sit in carries the state. */
.condition-block.has-error {
    border-color: var(--danger);
}

/* A 20px checkbox cannot be tinted legibly; outline it instead. */
.field.has-error .checkbox-label input[type="checkbox"] {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

/* --- Conditions page --- */
.condition-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: clamp(20px, 5vw, 32px);
    margin-bottom: 20px;
}

.condition-text {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 20px;
}

.condition-note {
    font-size: 13px;
    color: var(--gold-deep);
    font-style: italic;
    margin-bottom: 20px;
}

.gold-link {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.gold-link:hover {
    color: var(--gold-soft);
}

/* --- Radio buttons --- */
.radio-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.radio-label input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    flex: none;
}

.radio-label input[type="radio"]:checked {
    border-color: var(--gold);
}

.radio-label input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.radio-label:has(input:checked) {
    border-color: var(--border-gold);
    background: rgba(248, 211, 83, 0.05);
}

/* --- Upload zone ---
   The <label> is the click/tap target and fills the whole zone. The input is
   visually hidden but NOT display:none — a hidden-but-required control is
   unfocusable, and browsers then refuse to submit the form without ever
   telling the user why. That was the "upload sometimes does nothing" bug. */
.upload-zone {
    position: relative;
    border: 1px dashed var(--border);
    background: var(--bg-card);
    border-radius: 6px;
    text-align: center;
    margin-bottom: 28px;
    transition: border-color 0.2s, background 0.2s;
}

.upload-input {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 132px;
    padding: 28px 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(248, 211, 83, 0.12);
}

.upload-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    overflow-wrap: anywhere;          /* long filenames must not widen the page */
}

.upload-hint {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Hover effects only where a real pointer exists — on touch screens :hover
   sticks after a tap and left the zone stuck in its hover colours. */
@media (hover: hover) and (pointer: fine) {
    .upload-zone:hover {
        border-color: var(--gold-deep);
        background: var(--bg-hover);
    }
    .radio-label:hover {
        border-color: rgba(248, 211, 83, 0.3);
        background: rgba(248, 211, 83, 0.03);
    }
}

.upload-input:focus-visible + .upload-label {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.upload-zone.is-dragging {
    border-color: var(--gold);
    background: rgba(248, 211, 83, 0.07);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--gold);
    background: rgba(248, 211, 83, 0.04);
}

.upload-zone.has-file .upload-text {
    color: var(--white);
}

.upload-zone.has-error {
    border-style: solid;
    border-color: var(--danger);
    background: rgba(240, 96, 96, 0.06);
}

.upload-zone.has-error .upload-text {
    color: var(--danger);
}

.file-remove {
    display: none;
    margin: 0 auto 16px;
    padding: 8px 16px;
    min-height: 44px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.file-remove:hover {
    color: var(--danger);
}

.upload-zone.has-file .file-remove {
    display: block;
}

.upload-zone.has-file .upload-label {
    min-height: 0;
    padding-bottom: 8px;
}

/* --- Checkbox --- */
.checkbox-field {
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.5;
    padding: 8px 0;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    flex: none;
    accent-color: var(--gold);
    cursor: pointer;
}

/* --- Submit button --- */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    font-family: 'Archivo', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.02em;
    padding: 16px 36px;
    border: none;
    background: var(--gold);
    color: var(--bg);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .btn-submit:hover {
        background: var(--gold-soft);
        transform: translateY(-1px);
    }
    .btn-submit:hover .btn-dash {
        transform: translateX(4px);
    }
}

.btn-submit:active {
    transform: none;
}

.btn-submit:disabled,
.btn-submit.is-busy {
    opacity: 0.6;
    cursor: progress;
    transform: none;
}

.btn-submit.is-busy .btn-dash {
    animation: dash-pulse 0.9s ease-in-out infinite;
}

@keyframes dash-pulse {
    0%, 100% { opacity: 1; transform: none; }
    50%      { opacity: 0.35; transform: translateX(6px); }
}

.btn-dash {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--bg);
    transition: transform 0.2s;
}

/* no pseudo-element fill animation — keep it clean */
.btn-submit::before {
    display: none;
}

/* --- Thank You --- */
.thank-you {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    min-height: 70svh;
    text-align: center;
    padding: 40px clamp(20px, 5vw, 24px);
}

.thank-you-dash {
    display: block;
    width: 48px;
    height: 3px;
    background: var(--gold);
    margin-bottom: 32px;
    border-radius: 2px;
}

.thank-you h1 {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: clamp(26px, 5vw, 42px);
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}

.thank-you p {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.7;
}

/* The e-mail receipt is a footnote to the line above, not a second headline —
   and it carries the block's bottom margin now that it is the last thing here.
   Two classes so it outranks `.thank-you p`, which is only one class deep. */
.thank-you .thank-you-note {
    font-size: 15px;
    margin-bottom: 36px;
}

/* --- Privacy policy page --- */
.policy-updated {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.policy-section {
    margin-bottom: 36px;
}

.policy-section p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 16px;
}

.policy-section p:last-child,
.policy-section ul:last-child {
    margin-bottom: 0;
}

.policy-section ul {
    list-style: none;
    margin-bottom: 16px;
}

.policy-section li {
    position: relative;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    padding-left: 20px;
    margin-bottom: 8px;
}

.policy-section li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--gold);
}

.policy-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
}

/* Legal-basis table: scrolls inside its own box rather than widening the page. */
.policy-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 420px;
}

.policy-table th,
.policy-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
}

.policy-table th {
    font-family: 'Archivo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.policy-table td {
    color: var(--text);
}

/* --- Responsive ---
   760px, not 600px: between those two widths the absolutely centred <h1>
   used to overlap the logo. */
@media (max-width: 760px) {
    .form-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .form-header h1 {
        position: static;
        transform: none;
        white-space: normal;
    }

    .form-container {
        padding-top: 32px;
    }
}

@media (max-width: 600px) {
    .field-row {
        flex-direction: column;
        gap: 0;
    }

    .radio-row {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .btn-submit {
        width: 100%;
    }

    .section-title {
        margin-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
