/* =========================================================
   MALITO JOB FORM
   FIELDS + FLOATING LABELS + VALIDATION TOOLTIP
========================================================= */


/* =========================================================
   FIELD
========================================================= */

.field {
    position: relative;
    width: 100%;
}


/* =========================================================
   INPUT / TEXTAREA / SELECT
========================================================= */

.field input,
.field textarea,
.field select {
    width: 100%;
    box-sizing: border-box;

    padding: 14px 12px;

    border: 1.5px solid #555;
    border-radius: 10px;

    background: #050505;
    color: #ffffff;

    font-size: 14px;
    font-family: inherit;

    outline: none;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}


/* =========================================================
   TEXTAREA
========================================================= */

.field textarea {
    min-height: 100px;
    resize: vertical;
}


/* =========================================================
   SELECT
========================================================= */

.field select {
    appearance: none;
    cursor: pointer;

    padding-left: 40px;

    background-color: #050505;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
}


/* =========================================================
   SELECT OPTIONS
========================================================= */

.field select option {
    background: #111111;
    color: #ffffff;
}


/* =========================================================
   FLOATING LABEL
========================================================= */

.field label {
    position: absolute;

    right: 12px;
    top: 50%;

    transform: translateY(-50%);

    padding: 0 6px;

    background: #050505;

    color: #999999;

    font-size: 13px;
    font-weight: 400;

    pointer-events: none;

    transition:
        top 0.25s ease,
        font-size 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;

    z-index: 2;
}


/* =========================================================
   FLOATING LABEL — INPUT
========================================================= */

.field input:focus + label,
.field input:not(:placeholder-shown) + label,

.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,

.field select:focus + label,
.field select:valid + label {

    top: -6px;

    transform: translateY(0);

    font-size: 11px;

    color: #ffffff;
}


/* =========================================================
   FOCUS
========================================================= */

.field input:focus,
.field textarea:focus,
.field select:focus {

    border-color: #bfd730;

    box-shadow:
        0 0 0 3px rgba(191, 215, 48, 0.12);
}


/* =========================================================
   NORMAL HOVER
========================================================= */

.field input:hover,
.field textarea:hover,
.field select:hover {

    border-color: #777;
}


/* =========================================================
   ERROR STATE
========================================================= */

/*
   The validation JS adds:

       .field.error

   to the field wrapper.
*/

.field.error input,
.field.error textarea,
.field.error select {

    border-color: #dc2626 !important;

    box-shadow:
        0 0 0 2px rgba(220, 38, 38, 0.15);
}


/* =========================================================
   ERROR + FOCUS
========================================================= */

.field.error input:focus,
.field.error textarea:focus,
.field.error select:focus {

    border-color: #ef4444 !important;

    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.18);
}


/* =========================================================
   ERROR LABEL
========================================================= */

.field.error label {

    color: #ff6b6b;
}


/* =========================================================
   ERROR TOOLTIP
========================================================= */

.error-tooltip {

    position: absolute;

    right: 0;

    /*
       Place the tooltip underneath the field.
       Increase this value if your inputs are taller.
    */
    top: calc(100% + -2px);

    max-width: 100%;

    padding: 5px 7px;

    box-sizing: border-box;

    background: #dc2626;

    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 6px;

    font-size: 9px;
    font-weight: 500;

    line-height: 1.5;

    white-space: normal;

    text-align: right;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.35);

    opacity: 0;

    visibility: hidden;

    transform: translateY(-5px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;

    pointer-events: none;

    z-index: 20;
}


/* =========================================================
   SHOW TOOLTIP
========================================================= */

.field.error .error-tooltip {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   TOOLTIP ARROW
========================================================= */

.error-tooltip::before {

    content: "";

    position: absolute;

    top: -5px;
    right: 12px;

    width: 9px;
    height: 9px;

    background: #dc2626;

    transform: rotate(45deg);

    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}


/* =========================================================
   REQUIRED ERROR CLASS
========================================================= */

/*
   Kept for compatibility with the validation JS.
*/

.step .required-error {

    border-color: #dc2626 !important;

    box-shadow:
        0 0 0 2px rgba(220, 38, 38, 0.15);
}


/* =========================================================
   STEP HINT
========================================================= */

.step .step-hint {
    margin-top: 30px;
    margin-bottom: 3px;
margin-right: 10px;
    padding: 9px 12px;

    width: fit-content;
    max-width: 90%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    white-space: normal;
    border-radius: 7px;

    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.18);

    color: #ff7777;

    font-size: 12px;
    font-weight: 500;

    line-height: 1.7;
    text-align: right;

    opacity: 0;
    visibility: hidden;

    transform: translateY(5px);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
}


/* =========================================================
   SHOW STEP HINT
========================================================= */

.step .step-hint.show {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   FIELDS GRID
========================================================= */

.fields-grid {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

    /*
       Extra room for animated tooltips.
    */
    row-gap: 30px;
}


/* =========================================================
   GRID SPANS
========================================================= */

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}


/* =========================================================
   COLLAPSIBLE FIELDS
========================================================= */

.collapsible {

    display: none;

    opacity: 0;

    transform: translateY(-12px);

    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


.collapsible.show {

    display: block;

    opacity: 1;

    transform: translateY(0);
}


/* =========================================================
   FILE INPUT
========================================================= */

.field input[type="file"] {

    padding: 11px 12px;

    cursor: pointer;
}


.field input[type="file"]::file-selector-button {

    margin-left: 10px;

    padding: 7px 12px;

    border: none;

    border-radius: 6px;

    background: #222222;

    color: #ffffff;

    cursor: pointer;

    transition: background 0.2s ease;
}


.field input[type="file"]::file-selector-button:hover {

    background: #333333;
}


/* =========================================================
   NUMBER INPUT
========================================================= */

/* Remove browser arrows */

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {

    opacity: 0.5;
}


/* =========================================================
   DISABLED NEXT BUTTON
========================================================= */

.job-next.disabled,
.job-next:disabled {

    opacity: 0.45;

    cursor: not-allowed;

    pointer-events: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {

    .fields-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

    .fields-grid {

        grid-template-columns: 1fr;

        gap: 16px;

        row-gap: 28px;
    }


    .span-2,
    .span-3 {

        grid-column: span 1;
    }


    .error-tooltip {

        right: 0;

        max-width: 95%;

        font-size: 9px;

        padding: 4px 7px;
    }


    .step .step-hint {

        font-size: 11px;

        padding: 8px 10px;
    }

}


.required-mark {
    color: #d32f2f;
    font-weight: 700;
    margin-right: 2px;
}