/* Auth modal (BEM) */
.auth-modal {
    --auth-accent: var(--color3);
    --auth-dark: var(--color1);
    --auth-border: var(--color7);
    --auth-bg: var(--color5);
    --auth-text: var(--color6);
    --auth-soft: #fff3e8;
}

.auth-modal__dialog {
    max-width: 460px;
}

.auth-modal__content {
    border-radius: 22px;
    border: 1px solid var(--auth-border);
    overflow: hidden;
    background: var(--auth-bg);
    box-shadow: 0 16px 45px rgba(6, 7, 113, 0.15);
}

.auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    background: linear-gradient(135deg, rgba(255, 108, 12, 0.15), rgba(6, 7, 113, 0.08));
}

.auth-modal__titles {
    display: grid;
    gap: 6px;
}

.auth-modal__title {
    font-family: 'yekanbakh_bold';
    font-size: 20px;
    color: var(--auth-dark);
}

.auth-modal__subtitle {
    font-size: 14px;
    color: var(--auth-text);
}

.auth-modal__close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-bg);
    position: relative;
    cursor: pointer;
}

.auth-modal__close::before,
.auth-modal__close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    background: var(--auth-text);
    top: 50%;
    left: 50%;
    transform-origin: center;
}

.auth-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.auth-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.auth-modal__body {
    padding: 20px 22px 24px;
}

.auth-modal__notice {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid transparent;
}

.auth-modal__notice--error {
    background: #fff1f1;
    border-color: #f3c0c0;
    color: #a31515;
}

.auth-modal__notice--success {
    background: #ecf8f1;
    border-color: #b9e2cc;
    color: #1b6b3a;
}

.auth-modal__step {
    display: grid;
    gap: 12px;
}

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

.auth-modal__label {
    font-family: 'yekanbakh_medium';
    font-size: 14px;
    color: var(--auth-text);
}

.auth-modal__input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    font-size: 15px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.auth-modal__input[type="tel"] {
    direction: ltr;
    text-align: left;
}

.auth-modal__input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(255, 108, 12, 0.15);
}

.auth-modal__hint {
    font-size: 13px;
    color: var(--auth-text);
}

.auth-modal__submit {
    width: 100%;
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    background: var(--auth-accent);
    color: #fff;
    font-family: 'yekanbakh_medium';
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-modal__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 108, 12, 0.25);
}

.auth-modal__submit:disabled,
.auth-modal__link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-modal__phone-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--auth-soft);
}

.auth-modal__phone-label {
    font-size: 12px;
    color: var(--auth-text);
}

.auth-modal__phone-value {
    font-family: 'yekanbakh_medium';
    color: var(--auth-dark);
    direction: ltr;
}

.auth-modal__edit {
    margin-right: auto;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    position: relative;
    cursor: pointer;
}

.auth-modal__edit::before,
.auth-modal__edit::after {
    content: "";
    position: absolute;
    background: var(--auth-dark);
}

.auth-modal__edit::before {
    width: 14px;
    height: 2px;
    top: 13px;
    left: 7px;
    transform: rotate(-45deg);
}

.auth-modal__edit::after {
    width: 6px;
    height: 6px;
    top: 7px;
    left: 14px;
    border: 2px solid var(--auth-dark);
    border-radius: 2px;
    background: transparent;
}

.auth-modal__timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--auth-text);
}

.auth-modal__timer-value {
    font-family: 'yekanbakh_medium';
    color: var(--auth-dark);
}

.auth-modal__link {
    border: none;
    background: transparent;
    color: var(--auth-dark);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    text-align: right;
    padding: 0;
}

.auth-modal__link--muted {
    opacity: 0.7;
}

.auth-modal__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-modal__field {
    display: grid;
    gap: 8px;
}

.auth-modal__password {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-modal__password .auth-modal__input {
    padding-left: 44px;
}

.auth-modal__toggle {
    position: absolute;
    left: 10px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--auth-dark);
}

.auth-modal__toggle::before {
    content: "";
    position: absolute;
    inset: 8px 6px;
    border: 2px solid currentColor;
    border-radius: 16px / 10px;
}

.auth-modal__toggle::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    top: 14px;
    left: 14px;
}

.auth-modal__rules {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--auth-text);
}

.auth-modal__rule {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.auth-modal__rule::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--auth-border);
    display: inline-block;
    position: relative;
}

.auth-modal__rule.is-valid {
    color: #1b6b3a;
}

.auth-modal__rule.is-valid::before {
    border-color: #1b6b3a;
    background-color: #1b6b3a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3 3 7-7' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.auth-modal__actions {
    display: grid;
    gap: 8px;
}

@media (max-width: 575.98px) {
    .auth-modal__dialog {
        margin: 12px;
    }

    .auth-modal__header,
    .auth-modal__body {
        padding: 16px;
    }

    .auth-modal__grid {
        grid-template-columns: 1fr;
    }
}
