/* Navid auth modal — desktop Figma 3:14471 / mobile 3:18450+ */

.navid-auth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 564px;
    padding: 64px 124px;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}

.navid-auth-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--navid-tertiary);
    opacity: 0.8;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.navid-auth-modal__close:hover {
    background: #e2e3e5;
    opacity: 1;
}

.navid-auth-modal__close-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 0;
}

.navid-auth-modal__close-box .navid-icon {
    width: 24px;
    height: 24px;
}

.navid-auth-modal__step {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    gap: 32px;
}

.navid-auth-modal__step[hidden] {
    display: none !important;
}

.navid-auth-modal__main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    width: 100%;
}

.navid-auth-modal__footer {
    flex-shrink: 0;
    width: 100%;
}

.navid-auth-modal__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.navid-auth-modal__title {
    margin: 0;
    color: var(--navid-secondary);
    font-size: 24px;
    font-weight: 500;
    line-height: normal;
}

.navid-auth-modal__subtitle {
    margin: 0;
    color: var(--navid-gray);
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
}

.navid-auth-modal__subtitle--otp {
    display: none;
}

.navid-auth-modal__subtitle--desktop-only {
    display: block;
}

.navid-auth-modal__form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--navid-form-field-gap, 16px);
    width: 100%;
}

.navid-auth-modal__names {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.navid-auth-modal__names.is-hidden {
    display: none;
}

.navid-auth-modal__form-error,
.navid-auth-modal__otp-error {
    margin: 0;
    color: var(--navid-error);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    text-align: right;
}

.navid-auth-modal__otp-error {
    font-size: 12px;
    text-align: center;
    width: 100%;
}

.navid-auth-modal__form-error[hidden],
.navid-auth-modal__otp-error[hidden] {
    display: none !important;
}

.navid-auth-modal__cooldown {
    margin: 0;
    color: var(--navid-gray);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    text-align: center;
}

.navid-auth-modal__cooldown[hidden] {
    display: none !important;
}

.navid-auth-modal__submit.navid-btn {
    width: 100%;
    margin-top: 0;
}

.navid-auth-modal__submit.navid-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.navid-auth-modal__otp-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.navid-auth-modal__otp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    direction: ltr;
}

.navid-auth-modal__otp-input {
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid var(--navid-tertiary);
    border-radius: 4px;
    background: var(--navid-white);
    color: var(--navid-secondary);
    font-family: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.navid-auth-modal__otp-input::placeholder {
    color: var(--navid-gray-2);
    font-size: 15px;
    font-weight: 400;
}

.navid-auth-modal__otp-input:focus {
    outline: none;
    border-color: var(--navid-primary);
}

.navid-auth-modal__otp-input:not(:placeholder-shown) {
    font-size: 16px;
    font-weight: 500;
    color: var(--navid-secondary);
}

.navid-auth-modal__otp.is-invalid .navid-auth-modal__otp-input {
    border-color: var(--navid-error);
}

.navid-auth-modal__timer {
    margin: 0;
    min-height: 18px;
    color: var(--navid-gray);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    text-align: center;
}

.navid-auth-modal__resend {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--navid-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    text-align: center;
    cursor: pointer;
}

.navid-auth-modal__resend:hover {
    text-decoration: underline;
}

.navid-auth-modal__resend[hidden] {
    display: none !important;
}

/* ——— Mobile full-screen sheet (Figma 3:18450 … 3:19140) ——— */
@media (max-width: 991px) {
    .navid-auth-modal.navid-modal {
        padding: 0;
        align-items: stretch;
    }

    .navid-auth-modal .navid-modal__backdrop {
        background: rgba(35, 31, 32, 0.45);
    }

    .navid-auth-modal__dialog {
        display: flex;
        flex-direction: column;
        max-width: none;
        width: 100%;
        height: 100%;
        height: 100dvh;
        padding: 24px 16px;
        border-radius: 0;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .navid-auth-modal__close {
        top: 24px;
        left: 16px;
        width: 56px;
        height: 56px;
        background: transparent;
        opacity: 1;
    }

    .navid-auth-modal__close-box {
        width: 40px;
        height: 40px;
        border-radius: 4px;
        background: var(--navid-tertiary);
        opacity: 0.8;
    }

    .navid-auth-modal__step {
        flex: 1;
        min-height: 0;
        gap: 0;
        justify-content: space-between;
    }

    .navid-auth-modal__main {
        flex: 1;
        justify-content: center;
        gap: 40px;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navid-auth-modal__header {
        gap: 24px;
    }

    .navid-auth-modal__subtitle--otp {
        display: block;
    }

    .navid-auth-modal__subtitle--desktop-only {
        display: none !important;
    }

    .navid-auth-modal__form {
        gap: var(--navid-form-field-gap, 16px);
    }

    .navid-auth-modal__names.is-hidden {
        display: flex !important;
    }

    .navid-auth-modal__names.is-hidden[hidden] {
        display: flex !important;
    }

    .navid-auth-modal__names .navid-field.is-hidden-field {
        display: none !important;
    }

    .navid-auth-modal__otp {
        gap: 10px;
        padding: 0 24px;
        box-sizing: border-box;
    }

    .navid-auth-modal__otp-input {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 56px;
    }

    .navid-auth-modal__timer {
        font-size: 12px;
    }

    .navid-auth-modal__resend {
        font-size: 16px;
        font-weight: 600;
        text-align: right;
        width: 100%;
    }

    .navid-auth-modal__submit.navid-btn .navid-btn__icon {
        display: none;
    }

    .navid-auth-modal__submit.navid-btn {
        height: 56px;
        padding: 9px 16px;
        font-size: 16px;
        font-weight: 600;
    }
}

@media (max-width: 767px) {
    .navid-auth-modal__dialog {
        padding: 24px 16px;
    }
}

@media (min-width: 992px) {
    .navid-auth-modal__footer .navid-auth-modal__submit {
        margin-top: 16px;
    }

    #navid-auth-step-form .navid-auth-modal__footer {
        margin-top: 0;
    }

    #navid-auth-step-form .navid-auth-modal__form {
        padding-bottom: 0;
    }
}
