/*
 * H-Gaza Application Form
 * Public-facing, editorial form styling.
 * Typography is intentionally normalised to a clean website stack. No shadows, no gradients.
 */

.hgaza-form,
.hgaza-notices,
.hgaza-client-errors,
.hgaza-success {
    --hgaza-text: var(--wp--preset--color--contrast, #24262b);
    --hgaza-muted: #565f68;
    --hgaza-base: var(--wp--preset--color--base, #ffffff);
    --hgaza-accent: var(--wp--preset--color--primary, #00a5b5);
    --hgaza-accent-dark: #008995;
    --hgaza-border: #d8dde3;
    --hgaza-line: #cfd7dd;
    --hgaza-pastel-blue: #dff0f8;
    --hgaza-pastel-sand: #f2ecd0;
    --hgaza-pastel-rose: #eadfd6;
    --hgaza-pastel-green: #e4f2e7;
    --hgaza-pastel-grey: #eef1f2;
    --hgaza-panel-soft: rgba(255, 255, 255, .56);
    --hgaza-danger: #b42318;
    --hgaza-danger-bg: #fff0ed;
    --hgaza-danger-border: #e5483f;
    --hgaza-success: #027a48;
    --hgaza-success-bg: #eaf8ef;
    --hgaza-success-border: #1a9b64;
    --hgaza-radius-lg: 0;
    --hgaza-radius-md: 0;
    --hgaza-radius-pill: 999px;
    --hgaza-gap: clamp(1rem, 2vw, 1.45rem);
    color: var(--hgaza-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}


.hgaza-form code,
.hgaza-form pre,
.hgaza-form kbd,
.hgaza-form samp,
.hgaza-notices code,
.hgaza-client-errors code,
.hgaza-success code {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.hgaza-form {
    display: block;
    max-width: 1080px;
    margin: 0 auto;
    line-height: 1.58;
}

.hgaza-form,
.hgaza-form * {
    box-sizing: border-box;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.hgaza-section {
    margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
    padding: clamp(1.35rem, 3vw, 2.2rem);
    background: var(--hgaza-pastel-blue);
}

.hgaza-section:nth-of-type(2n) {
    background: var(--hgaza-pastel-sand);
}

.hgaza-section:nth-of-type(3n) {
    background: var(--hgaza-pastel-rose);
}

.hgaza-section:nth-of-type(4n) {
    background: var(--hgaza-pastel-green);
}

.hgaza-intro,
.hgaza-section-additional,
.hgaza-submit-section {
    background: var(--hgaza-pastel-grey);
}

.hgaza-section-documents {
    background: var(--hgaza-pastel-rose);
}

.hgaza-section-consent {
    background: var(--hgaza-pastel-sand);
}

.hgaza-intro p:last-child,
.hgaza-section p:last-child {
    margin-bottom: 0;
}

.hgaza-section h2,
.hgaza-section h3 {
    margin: 0;
    color: var(--hgaza-text);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.hgaza-section h2 {
    margin-bottom: clamp(1rem, 2vw, 1.35rem);
    font-size: clamp(1.85rem, 4vw, 3rem);
    font-weight: 800;
}

.hgaza-section h3 {
    margin-top: clamp(1.45rem, 2.2vw, 2rem);
    margin-bottom: .85rem;
    font-size: clamp(1.18rem, 2.4vw, 1.7rem);
    font-weight: 800;
}

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

.hgaza-section p {
    max-width: 78ch;
}

.hgaza-section a {
    color: var(--hgaza-accent-dark);
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}

.hgaza-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hgaza-gap);
    align-items: start;
}

.hgaza-email-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    align-items: end;
    margin-top: -.2rem;
}

.hgaza-email-pair .hgaza-field {
    margin-bottom: 0;
}

.hgaza-field,
.hgaza-options label,
.hgaza-fieldset label,
.hgaza-section > label,
.hgaza-conditional > label {
    display: block;
    margin-bottom: .95rem;
}

.hgaza-field span {
    display: block;
    margin-bottom: .42rem;
    font-weight: 700;
    line-height: 1.35;
}

.hgaza-field em {
    color: var(--hgaza-danger);
    font-style: normal;
    font-weight: 800;
}

.hgaza-field input[type="text"],
.hgaza-field input[type="date"],
.hgaza-field input[type="email"],
.hgaza-field textarea,
.hgaza-field input[type="file"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--hgaza-border);
    border-radius: var(--hgaza-radius-md);
    background: var(--hgaza-base);
    color: var(--hgaza-text);
    font: inherit;
}

.hgaza-field input[type="text"],
.hgaza-field input[type="date"],
.hgaza-field input[type="email"],
.hgaza-field textarea {
    padding: .82rem .9rem;
}

.hgaza-field input[type="file"] {
    padding: .7rem;
    background: var(--hgaza-base);
}

.hgaza-field input[type="file"]::file-selector-button {
    margin-right: .85rem;
    padding: .58rem .85rem;
    border: 0;
    border-radius: var(--hgaza-radius-pill);
    background: var(--hgaza-accent);
    color: var(--hgaza-base);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.hgaza-field input[type="file"]::file-selector-button:hover {
    background: var(--hgaza-accent-dark);
}

.hgaza-field textarea {
    min-height: 145px;
    resize: vertical;
}

.hgaza-field input:focus,
.hgaza-field textarea:focus {
    outline: 3px solid rgba(0, 165, 181, .22);
    outline-offset: 2px;
    border-color: var(--hgaza-accent-dark);
}

.hgaza-options input:focus-visible,
.hgaza-fieldset input:focus-visible,
.hgaza-section > label input:focus-visible,
.hgaza-conditional > label input:focus-visible,
.hgaza-submit:focus-visible {
    outline: 3px solid rgba(0, 165, 181, .28);
    outline-offset: 3px;
}

.hgaza-field-full {
    grid-column: 1 / -1;
}

.hgaza-options,
.hgaza-fieldset {
    display: grid;
    gap: .7rem;
}

.hgaza-options label,
.hgaza-fieldset label,
.hgaza-section > label,
.hgaza-conditional > label {
    position: relative;
    margin-bottom: 0;
    padding: .85rem .9rem .85rem 2.55rem;
    background: rgba(255, 255, 255, .62);
    cursor: pointer;
}

.hgaza-options input,
.hgaza-fieldset input,
.hgaza-section > label input,
.hgaza-conditional > label input {
    position: absolute;
    left: .9rem;
    top: 1rem;
    transform: scale(1.08);
    accent-color: var(--hgaza-accent);
}

.hgaza-options label:has(input:checked),
.hgaza-fieldset label:has(input:checked),
.hgaza-section > label:has(input:checked),
.hgaza-conditional > label:has(input:checked) {
    background: rgba(255, 255, 255, .82);
}

.hgaza-fieldset {
    margin: 0 0 1.45rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.hgaza-fieldset legend {
    max-width: 100%;
    margin-bottom: .75rem;
    padding: 0;
    font-weight: 800;
    line-height: 1.32;
}

.hgaza-help,
.hgaza-upload-help {
    margin-top: .55rem;
    color: var(--hgaza-muted);
}

.hgaza-dependent,
.hgaza-conditional {
    margin-top: .9rem;
}

.hgaza-upload {
    margin: 0 0 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, .56);
}

.hgaza-upload-header {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: .45rem;
}

.hgaza-upload-title {
    display: block;
    font-weight: 800;
    line-height: 1.28;
}

.hgaza-upload-description {
    margin: 0 0 .7rem;
    color: var(--hgaza-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.hgaza-upload .hgaza-field {
    margin-bottom: 0;
}

.hgaza-badge {
    flex: 0 0 auto;
    padding: .24rem .58rem;
    border-radius: var(--hgaza-radius-pill);
    font-size: .82em;
    font-weight: 800;
    line-height: 1.2;
}

.hgaza-badge-required {
    background: #ffe5df;
    color: var(--hgaza-danger);
}

.hgaza-badge-optional {
    background: #e7f3f5;
    color: var(--hgaza-accent-dark);
}

.hgaza-field-error {
    margin: .65rem 0 0;
    padding: .65rem .75rem;
    background: var(--hgaza-danger-bg);
    border-left: 5px solid var(--hgaza-danger-border);
    color: var(--hgaza-danger);
    font-weight: 800;
}

.hgaza-upload-error {
    background: #fff7f5;
}

.hgaza-notices,
.hgaza-client-errors,
.hgaza-success {
    max-width: 1080px;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.25rem;
}

.hgaza-notices,
.hgaza-client-errors {
    border: 2px solid var(--hgaza-danger-border);
    background: var(--hgaza-danger-bg);
    color: var(--hgaza-danger);
}

.hgaza-notices p,
.hgaza-client-errors p,
.hgaza-success p {
    margin: .35rem 0;
}

.hgaza-client-errors ul {
    margin: .75rem 0 0 1.25rem;
}

.hgaza-client-errors li {
    margin: .35rem 0;
    font-weight: 700;
}

.hgaza-success {
    border: 2px solid var(--hgaza-success-border);
    background: var(--hgaza-success-bg);
    color: var(--hgaza-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.hgaza-success h2 {
    margin-top: 0;
    font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.hgaza-submit-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: clamp(1.4rem, 2.6vw, 2rem);
    background: transparent;
}

.hgaza-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: .95rem 1.55rem;
    border: 0;
    border-radius: var(--hgaza-radius-pill);
    background: var(--hgaza-accent);
    color: var(--hgaza-base);
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.hgaza-submit:hover,
.hgaza-submit:focus-visible {
    background: var(--hgaza-accent-dark);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .hgaza-grid,
    .hgaza-email-pair {
        grid-template-columns: 1fr;
    }

    .hgaza-email-pair {
        gap: .4rem;
    }

    .hgaza-section h2 {
        font-size: clamp(1.65rem, 8vw, 2.35rem);
    }
}

@media (max-width: 600px) {
    .hgaza-form,
    .hgaza-notices,
    .hgaza-client-errors,
    .hgaza-success {
        max-width: 100%;
    }

    .hgaza-section {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .hgaza-options label,
    .hgaza-fieldset label,
    .hgaza-section > label,
    .hgaza-conditional > label {
        padding: .78rem .75rem .78rem 2.35rem;
    }

    .hgaza-options input,
    .hgaza-fieldset input,
    .hgaza-section > label input,
    .hgaza-conditional > label input {
        left: .75rem;
        top: .94rem;
    }

    .hgaza-upload {
        padding: .85rem;
    }

    .hgaza-upload-header {
        display: block;
    }

    .hgaza-badge {
        display: inline-block;
        margin-top: .45rem;
    }

    .hgaza-field input[type="file"]::file-selector-button {
        display: block;
        width: 100%;
        margin: 0 0 .6rem 0;
    }

    .hgaza-submit-section {
        padding: 1rem 0 0;
    }

    .hgaza-submit {
        width: 100%;
        min-height: 56px;
    }
}
