/* Стили форм авторизации/регистрации ВГД (signin/signup).
   Минималистично, без CSS-переменных/grid/flex/transitions —
   совместимо со старыми мобильными браузерами. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #e8e8e8;
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

.auth-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding: 24px 12px 40px 12px;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    margin: auto; /* центрирует по вертикали и горизонтали в свободном месте; при переполнении — flush to top, скролл с верха */
    padding: 28px 22px;
    border: 1px solid #ddd;
}

.auth-title {
    margin: 0 0 18px 0;
    padding: 0;
    font-size: 22px;
    font-weight: bold;
    color: #2d584a;
    text-align: center;
    text-transform: uppercase;
}

.auth-logo {
    height: 28px;
    width: auto;
    vertical-align: middle;
    margin-bottom: 3px;
    -webkit-filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.6));
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.6));
}

.auth-subtitle {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.auth-label {
    display: block;
    margin: 12px 0 6px 0;
    font-size: 14px;
    color: #555;
}

.auth-field {
    display: block;
    width: 100%;
    margin: 0 0 4px 0;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-field:focus {
    border-color: #2d584a;
}

/* Поле + сообщение об ошибке в одной обёртке.
   Сообщение всегда занимает 1 строку (min-height) — пустое не сдвигает контролы.
   Если текст в 2+ строки (нештатно) — раздвинет, это допускается. */
.auth-row {
    margin: 0;
}

.auth-row .auth-field {
    margin: 0;
}

.auth-error,
.etext {
    display: block;
    margin: 4px 0 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.35;
    color: #d8000c;
    text-align: left;
}

/* Резервируем место под одну строку только внутри .auth-row.
   errortext1 и globalRegistrationError остаются вне auth-row и не занимают места,
   когда пусты — появятся динамически и подвинут контент (редкий случай). */
.auth-row .auth-error,
.auth-row .etext {
    min-height: 1.35em;
}

.auth-captcha {
    display: block;
    height: 60px;
    width: auto;
    max-width: 100%;
    margin: 6px 0 8px 0;
    border: 1px solid #eee;
    background: #fff;
}

.auth-button {
    display: block;
    width: 100%;
    margin: 18px 0 6px 0;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: bold;
    font-family: inherit;
    color: #fff;
    background: #2d584a;
    border: 0;
    cursor: pointer;
    border-radius: 0;
    text-align: center;
    text-decoration: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-button:hover { color: #fff; text-decoration: none; }

.auth-button:hover { background: #224236; }
.auth-button:active { background: #1a342a; }

/* Вторичная кнопка: зелёная обводка на белом фоне. */
.auth-button-outline {
    display: block;
    width: 100%;
    margin: 18px 0 6px 0;
    padding: 12px 16px;
    font-size: 17px;
    font-weight: bold;
    font-family: inherit;
    color: #2d584a;
    background: #fff;
    border: 2px solid #2d584a;
    cursor: pointer;
    border-radius: 0;
    text-align: center;
    text-decoration: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-button-outline:hover {
    color: #fff;
    background: #2d584a;
    text-decoration: none;
}

.auth-button-outline:active {
    background: #1a342a;
    border-color: #1a342a;
    color: #fff;
}

/* Несколько кнопок подряд (любого типа) — плотнее, чем дефолтные 18px сверху. */
.auth-button + .auth-button,
.auth-button + .auth-button-outline,
.auth-button-outline + .auth-button-outline,
.auth-button-outline + .auth-button {
    margin-top: 8px;
}

.auth-links {
    margin: 16px 0 0 0;
    padding: 0;
    text-align: center;
    font-size: 14px;
}

.auth-links a {
    display: inline-block;
    margin: 4px 6px;
    padding: 4px 0;
    color: #2d584a;
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

.auth-help {
    margin: 18px 0 0 0;
    padding: 0;
    text-align: center;
    font-size: 13px;
    color: #555;
}

.auth-help a {
    color: #2d584a;
    text-decoration: none;
}

.auth-help a:hover { text-decoration: underline; }

.auth-disclaimer {
    margin: 16px 0 0 0;
    padding: 12px 0 0 0;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #777;
    text-align: left;
    line-height: 1.45;
}

.auth-disclaimer a {
    color: #2d584a;
    text-decoration: none;
}

.auth-disclaimer a:hover { text-decoration: underline; }

.auth-global-error {
    margin: 8px 0 0 0;
    padding: 0;
    text-align: center;
    font-size: 14px;
    color: #d8000c;
}

.auth-progress {
    width: 100%;
    height: 4px;
    margin: 20px 0 0 0;
    background: #eee;
    overflow: hidden;
}

.auth-progress-bar {
    width: 0;
    height: 100%;
    background: #2d584a;
    -webkit-animation: auth-fill 2s linear forwards;
    animation: auth-fill 2s linear forwards;
}

@-webkit-keyframes auth-fill {
    from { width: 0; }
    to { width: 100%; }
}
@keyframes auth-fill {
    from { width: 0; }
    to { width: 100%; }
}

/* fieldset reset */
fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}
legend { display: none; }

/* Мобильные: убираем серый фон вокруг и рамку у карточки,
   карточка и контролы — на всю ширину экрана, прижата к верху. */
@media (max-width: 599px) {
    html, body { background: #fff; }
    .auth-desktop-only { display: none; }
    .auth-wrap {
        display: block;
        padding: 0;
        min-height: 0;
    }
    .auth-card {
        max-width: 100%;
        margin: 0;
        padding: 0 14px 28px 14px; /* боковые отступы для контента, сверху прижато к экрану */
        border: 0;
    }
    .auth-title {
        margin-top: 16px; /* лёгкий зазор от статус-бара */
        font-size: 20px;
    }
    .auth-logo { height: 26px; }
}

/* Крупный экран */
@media (min-width: 600px) {
    .auth-wrap { padding: 48px 16px 60px 16px; }
    .auth-card { padding: 36px 36px; }
    .auth-title { font-size: 24px; }
}
