*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f7f7f6;
    color: #141414;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* Контейнер авторизации */
.auth-wrap {
    max-width: 420px;
    margin: 36px auto;
    padding: 0 16px;
}

.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo {
    text-decoration: none;
    color: #141414;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Системные уведомления */
.auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.auth-alert.show {
    display: block;
}

.auth-alert.alert-ok {
    background: #eef8f1;
    color: #155724;
    border-color: #c3e6cb;
}

.auth-alert.alert-error {
    background: #fdf2f2;
    color: #842029;
    border-color: #f5c2c7;
}

.auth-alert.alert-warn {
    background: #fffbeb;
    color: #78350f;
    border-color: #fde68a;
}

/* Экраны и карточки */
.auth-screen {
    display: none;
}

.auth-screen.active {
    display: block;
}

.card-box {
    background: #ffffff;
    border: 1px solid #e6e6e4;
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Вкладки Вход / Регистрация */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f2f2f0;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.auth-tab {
    border: none;
    background: transparent;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-tab.active {
    background: #ffffff;
    color: #141414;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Заголовки подэкранов */
.subscreen-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    margin-bottom: 4px;
}

.eyebrow.warn {
    color: #b45309;
}

.screen-title {
    font-size: 22px;
    font-weight: 700;
    color: #141414;
    margin-bottom: 12px;
}

.subscreen-top .screen-title {
    margin-bottom: 0;
}

.meta-block {
    background: #f8f8f7;
    border: 1px solid #ececea;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #444444;
    margin-bottom: 18px;
}

/* Поля формы */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

.field-input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #d4d4d2;
    border-radius: 10px;
    font-size: 15px;
    color: #141414;
    background: #ffffff;
    transition: border-color 0.15s ease;
}

.field-input:focus {
    outline: none;
    border-color: #141414;
}

.field-note {
    font-size: 12px;
    color: #737373;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .field-input {
    padding-right: 42px;
}

.btn-toggle-pass {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.55;
    padding: 4px;
}

.btn-toggle-pass:hover {
    opacity: 1;
}

/* Поле ввода 4-значного кода */
.code-input {
    height: 54px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.45em;
    padding-left: 24px;
}

/* Кнопки */
.btn-dark {
    width: 100%;
    height: 46px;
    background: #141414;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s ease;
}

.btn-dark:hover {
    background: #2b2b2b;
}

.btn-quiet {
    background: #f4f4f2;
    color: #262626;
    border: 1px solid #e0e0de;
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-quiet:hover {
    background: #eaeae8;
}

.resend-row {
    text-align: center;
    margin-top: 14px;
}

.btn-link-muted {
    background: none;
    border: none;
    font-size: 13px;
    color: #141414;
    text-decoration: underline;
    cursor: pointer;
}

.btn-link-muted:disabled {
    color: #8c8c8c;
    text-decoration: none;
    cursor: default;
}
