.waiiz-application {
    --purple: #24a0c5;
    --purple2: #1b849f;
    --ink: #230059;
    --muted: #6f6a82;
    --bg: #f6f7fb;
    --line: #e6e4ee;
    --soft: #eaf8fc;
    --good: #eaf8ef;
    --bad: #fff0f2;

    background: var(--bg);
    padding: 28px 0 60px;
    color: var(--ink);
}
#applicationMessage{
    margin-bottom: 10px;
}
.waiiz-application *,
.waiiz-application *::before,
.waiiz-application *::after {
    box-sizing: border-box;
}

.waiiz-application button,
.waiiz-application input,
.waiiz-application select,
.waiiz-application textarea {
    font: inherit;
}

.waiiz-application button {
    cursor: pointer;
}

.waiiz-application a {
    margin-right: 15px;
}

/* =========================================
MAIN CONTAINER
========================================= */

.application-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
STEPS
========================================= */

.application-steps {
    display: flex;
    gap: 8px;
    margin: 4px 0 26px;
}

.application-step {
    flex: 1;
    text-align: center;
    color: #8b8696;
    font-size: 12px;
    padding-bottom: 8px;
    border-bottom: 3px solid #dedbe6;
    transition: all 0.2s ease;
}

.application-step.active {
    color: var(--purple);
    border-color: var(--purple2);
    font-weight: 800;
}

.application-step.completed {
    color: var(--purple);
    border-color: #72bfd2;
}

.step-label {
    display: inline-block;
}

/* =========================================
APPLICATION CARD
========================================= */

.application-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(28, 17, 63, 0.05);
    padding: 26px;
}

.application-panel {
    display: none;
}

.application-panel.active {
    display: block;
}

.application-panel h1,
.application-panel h2 {
    color: var(--ink);
}

.application-panel h2 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 8px;
    font-weight: 700;
}

.application-panel h3 {
    color: var(--ink);
}

/* =========================================
COMMON
========================================= */

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.req {
    color: #c7254e;
}

/* =========================================
POSITION / BANNER
========================================= */

.banner {
    background: var(--soft);
    border-left: 4px solid var(--purple2);
    padding: 14px 16px;
    border-radius: 9px;
    margin: 16px 0;
}

.banner b {
    font-weight: 600;
    color: var(--ink);
}

.banner .small {
    color: var(--muted);
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.actions-right {
    display: flex;
    gap: 10px;
}

/* =========================================
BUTTONS
========================================= */

.btn-primary {
    border: 0;
    background: linear-gradient(90deg, var(--purple), var(--purple2));
    color: #fff;
    border-radius: 9px;
    padding: 13px 20px;
    font-weight: 700 !important;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: var(--purple);
    border: 1px solid #5fb4cc;
    border-radius: 9px;
    padding: 12px 18px;
    font-weight: 700 !important;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #fff;
    color: var(--purple);
    border: 1px solid #5fb4cc;
}

/* =========================================
FORMS
========================================= */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.city-combobox {
    position: relative;
}

.country-combobox {
    position: relative;
}

.country-combobox input#currentCountry {
    padding-right: 48px;
    padding-left: 50px;
}

.country-combobox .country-flag.fi {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 15px;
    min-width: 22px;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.country-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
}

.country-toggle:hover,
.country-toggle:focus-visible {
    background: var(--soft);
    color: var(--purple2);
    outline: none;
}

.country-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.country-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #d9d6e4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 17, 63, 0.12);
}

.country-option {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.country-option:hover,
.country-option:focus-visible {
    background: var(--soft);
    outline: none;
}

.country-option-flag {
    flex: 0 0 24px;
    width: 24px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.city-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #d9d6e4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 17, 63, 0.12);
}

.city-option {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.city-option:hover,
.city-option:focus-visible {
    background: var(--soft);
    outline: none;
}

.city-options-empty {
    display: block;
    padding: 9px 11px;
    color: var(--muted);
    font-size: 13px;
}

.location-data-credit {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.location-data-credit a {
    color: var(--purple2);
    text-decoration: underline;
}

.waiiz-application label {
    display: block;
    font-weight: 650;
    font-size: 14px;
    margin: 14px 0 7px;
}

.waiiz-application input,
.waiiz-application select,
.waiiz-application textarea {
    width: 100%;
    border: 1px solid #d9d6e4;
    border-radius: 9px;
    padding: 13px 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.waiiz-application input:focus,
.waiiz-application select:focus,
.waiiz-application textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(36, 160, 197, 0.1);
}

.waiiz-application input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.waiiz-application textarea {
    min-height: 110px;
    resize: vertical;
}

/* =========================================
FIELD WRAPPER
========================================= */

.application-field {
    width: 100%;
    min-width: 0;
}

.application-field .application-message {
    width: 100%;
    margin-top: 8px;
}

/* =========================================
FIELD ERROR
========================================= */

.field-error {
    display: block;
    width: 100%;
    margin-top: 7px;
    color: #9a1f39;
    font-size: 13px;
    line-height: 1.4;
}

.field-error:empty {
    display: none;
}

/* =========================================
OTP
========================================= */

.otp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    margin-top: 18px;
    align-items: start;
}

.otp-row > * {
    min-width: 0;
}

.otp-row .btn-primary {
    width: 100%;
    min-height: 48px;
    white-space: nowrap;
}

.otp-section {
    margin-top: 20px;
}

.otp-section label {
    margin-top: 0;
}

.otp-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.application-link-button {
    border: 0;
    background: transparent;
    color: var(--purple);
    padding: 0;
    font-weight: 700;
    cursor: pointer;
}

.application-link-button:hover {
    color: var(--purple2);
}

.application-link-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================
APPLICATION MESSAGE
========================================= */

.application-message {
    width: 100%;
    display: block;
    clear: both;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.application-message:empty {
    display: none;
}

.message-success {
    background: var(--good);
    color: #1f6b38;
    border: 1px solid #bfe3ca;
}

.message-error {
    background: var(--bad);
    color: #9a1f39;
    border: 1px solid #f0c6cf;
}

/*
|--------------------------------------------------------------------------
| IMPORTANT
|--------------------------------------------------------------------------
| Prevent error messages from appearing beside inputs/buttons.
|--------------------------------------------------------------------------
*/

.waiiz-application .application-message {
    position: static;
    float: none;
}

.waiiz-application .field-error {
    position: static;
    float: none;
}

/* =========================================
STATUS
========================================= */

.status-good {
    background: var(--good);
    color: #1f6b38;
    border: 1px solid #bfe3ca;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

/* =========================================
WORK ARRANGEMENT
========================================= */

.rule-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.rule {
    background: #faf8fe;
    border: 1px solid #e8ddf5;
    padding: 14px;
    border-radius: 10px;
}

.rule b {
    display: block;
    margin-bottom: 5px;
}

.rule span {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* =========================================
UPLOADS
========================================= */

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
}

.upload-box {
    border: 1.5px dashed #8bc6d7;
    background: #f8fcfd;
    border-radius: 12px;
    padding: 18px;
}

.upload-box b {
    display: block;
    color: var(--ink);
    margin-bottom: 8px;
}

.upload-box input[type="file"] {
    padding: 8px 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.upload-box input[type="file"]:focus {
    box-shadow: none;
}

/* =========================================
CHARACTER COUNTER
========================================= */

.character-counter {
    text-align: right;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

/* =========================================
REVIEW
========================================= */

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.summary-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.summary-table td:first-child {
    font-weight: 700;
    width: 34%;
    color: var(--ink);
}

.summary-table td:last-child {
    color: var(--muted);
    word-break: break-word;
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 12px 0;
}

.checkbox-row input {
    width: auto;
    margin-top: 4px;
}

.checkbox-row label {
    margin: 0;
}

/* =========================================
JOB DESCRIPTION MODAL
========================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 13, 43, 0.62);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 9999;
}

.modal {
    background: #fff;
    width: min(900px, 96vw);
    max-height: 90vh;
    overflow: auto;
    border-radius: 16px;
    padding: 26px;
    position: relative;
    display: block;
}

.close {
    position: absolute;
    right: 18px;
    top: 14px;
    border: 0;
    background: none;
    font-size: 28px;
    color: #444;
    cursor: pointer;
}

.jd-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding-right: 30px;
}

.jd-head h2 {
    margin-top: 6px;
}

.jd-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.jd-side {
    background: #faf8fe;
    border: 1px solid #eee3f7;
    border-radius: 12px;
    padding: 16px;
}

.jd-side h3,
.jd-cols h3 {
    margin-top: 0;
}

.jd-cols li {
    margin-bottom: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.pill {
    display: inline-block;
    background: #eaf8fc;
    border: 1px solid #d3edf4;
    color: #24728a;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 12px;
}

/* =========================================
SUCCESS
========================================= */

.application-success-panel {
    display: none;
}

.success {
    text-align: center;
    padding: 34px;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--purple);
    font-size: 38px;
    font-weight: 800;
    margin: 0 auto 14px;
}

.success h2 {
    color: var(--ink);
}

.ref {
    display: inline-block;
    margin: 16px auto;
    padding: 14px 18px;
    background: #eaf8fc;
    border-radius: 9px;
    font-weight: 800;
    color: var(--purple2);
}

/* =========================================
HIDDEN
========================================= */

.hidden {
    display: none !important;
}

/* =========================================
RESPONSIVE
========================================= */

@media (max-width: 850px) {
    .application-container {
        width: 100%;
        padding: 0 15px;
    }

    .grid-2,
    .grid-3,
    .upload-grid {
        grid-template-columns: 1fr;
    }

    .otp-row {
        grid-template-columns: 1fr;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .actions-right {
        width: 100%;
        flex-direction: column;
    }

    .actions > button,
    .actions-right button {
        width: 100%;
    }

    .application-steps {
        overflow-x: auto;
    }

    .application-step {
        min-width: 110px;
    }

    .jd-cols {
        grid-template-columns: 1fr;
    }

    .jd-head {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .waiiz-application {
        padding: 20px 0 40px;
    }

    .application-card {
        padding: 18px;
        border-radius: 12px;
    }

    .application-panel h2 {
        font-size: 23px;
    }

    .application-steps {
        gap: 5px;
        overflow-x: auto;
    }

    .application-step {
        min-width: 90px;
        font-size: 11px;
    }

    .summary-table td {
        display: block;
        width: 100% !important;
    }

    .summary-table td:first-child {
        padding-bottom: 3px;
        border-bottom: 0;
    }

    .summary-table td:last-child {
        padding-top: 3px;
    }

    .otp-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .otp-row .btn-primary {
        width: 100%;
    }

    .otp-help {
        align-items: flex-start;
        flex-direction: column;
    }
}
