/* === Login page styles === */
/* Используется только на /logon/ (login.html). */

/* === Шапка, футер, фон body — оригинальные правила === */

html {
    position: relative;
    min-height: 100%;
}

body {
    padding-top: 40px;
    padding-bottom: 40px;
    background-image: url('/static/img/login-bg-v2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #08192d;
}

#footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    background-color: #f5f5f5;
}

.logon-footer {
    opacity: 0.6;
    height: 28px;
}

.logon-navbar-header {
    margin-top: 3px;
    user-select: none;
    cursor: default;
}

.logo-char-SH {
    font-weight: bold;
    font-size: 40px;
    height: 40px;
    margin-left: 5px;
}

.logo-char-K {
    font-weight: bold;
    font-size: 40px;
    height: 40px;
    margin-left: 5px;
    position: relative;
    left: -16px;
}

.footer-container {
    margin-left: 1%;
    font-weight: bold;
    font-size: 12px;
    cursor: default;
    text-align: center;
}

/* === Карточка авторизации === */

.auth-main {
    min-height: calc(100vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
            backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 16px 48px rgba(0, 0, 0, 0.35),
        0 0 80px rgba(13, 148, 136, 0.12);
    padding: 28px 32px 24px;
    position: relative;
    overflow: hidden;
    animation: auth-card-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* Тонкий цветной акцент сверху карточки */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 100%);
    z-index: 1;
}

/* Декоративный изумрудный glow в правом нижнем углу */
.auth-card::after {
    content: "";
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.22) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Логотип «ШК» — повторяет стиль из шапки (logo-char-SH/K),
   только крупнее. Буква К сдвинута влево, перекрывая Ш. */
.auth-card__logo {
    text-align: center;
    margin: 0 0 22px;
    line-height: 1;
    user-select: none;
    position: relative;
    z-index: 1;
    /* Прозрачность — на РОДИТЕЛЕ (не на каждой букве): буквы Ш и К
       перекрываются (К сдвинута влево), и per-char opacity складывала
       наложение в двойную плотность → лого выглядело «сдвоенным/кривым».
       На родителе группа композитится как один слой — перекрытие чистое. */
    opacity: 0.6;
}

.auth-card__logo .logo-char-SH,
.auth-card__logo .logo-char-K {
    font-size: 64px;
    height: auto;
    margin-left: 0;
    color: rgb(51, 51, 51);   /* тот же RGB, что у букв в шапке (navbar-default) */
}

.auth-card__logo .logo-char-K {
    /* left уточнён визуально (было -26px, владелец подобрал -20px).
       margin-right компенсирует layout, чтобы text-align: center
       выровнял блок визуально — оставлен как есть. */
    left: -20px;
    margin-right: -26px;
}

/* Форма — выше декоративного blob */
.auth-form {
    position: relative;
    z-index: 1;
}

/* === Inline alert === */
/* Стоит ПОД кнопкой и всегда резервирует фиксированное место
   (две строки текста + padding). При появлении ошибки текст
   проявляется через opacity — высота карточки и положение
   кнопки/полей не меняются. */

.auth-alert {
    visibility: hidden;
    opacity: 0;
    box-sizing: border-box;
    min-height: 56px;
    padding: 10px 14px;
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #f1c4c0;
    background: rgba(253, 236, 234, 0.92);
    color: #8a1c12;
    transition: opacity .2s ease;
}

.auth-alert.is-shown {
    visibility: visible;
    opacity: 1;
}

/* === Поля === */
/* Иконка позиционируется absolute поверх input — input получает
   полную ширину родителя, равную ширине кнопки. */

.auth-field {
    position: relative;
    margin-bottom: 12px;
}

.auth-field__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.auth-field .form-control,
.auth-input {
    width: 100%;
    height: 46px;
    padding-left: 44px;
    font-size: 16px;
    border: 1px solid #d0d4d9;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.auth-field .form-control:focus,
.auth-input:focus {
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
    outline: 0;
}

.auth-field.has-error .form-control,
.auth-field.has-error .auth-input {
    border-color: #c0392b;
}

.auth-field.has-error .form-control:focus,
.auth-field.has-error .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .15);
}

.hidden {
    display: none !important;
}

/* === Кнопка === */

.auth-submit {
    position: relative;
    width: 100%;
    margin-top: 6px;
    height: 48px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.30);
    transition: filter .15s ease, transform .05s ease, box-shadow .15s ease;
}

.auth-submit:hover,
.auth-submit:focus {
    color: #ffffff;
    background: linear-gradient(180deg, #2dd4bf 0%, #0f9b8e 100%);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.40);
    filter: brightness(1.03);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit[disabled],
.auth-submit[disabled]:hover {
    opacity: .85;
    cursor: progress;
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    filter: none;
}

/* Spinner — обёртка absolute (translate по вертикали),
   внутренний glyphicon крутится. Разделение нужно, чтобы
   keyframe rotate не сбрасывал translateY центрирования. */
.auth-submit .auth-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    margin: 0;
    width: 16px;
    height: 16px;
    line-height: 1;
    transform: translateY(-50%);
    visibility: hidden;
}

.auth-submit .auth-spinner.is-shown {
    visibility: visible;
}

.auth-submit .auth-spinner > .glyphicon {
    display: block;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* === Spinner-анимация === */

.glyphicon-spin {
    -webkit-animation: auth-glyph-spin 1s infinite linear;
            animation: auth-glyph-spin 1s infinite linear;
}

@-webkit-keyframes auth-glyph-spin {
    to { -webkit-transform: rotate(360deg); }
}

@keyframes auth-glyph-spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px 22px;
        border-radius: 14px;
    }
    .auth-card__logo .logo-char-SH,
    .auth-card__logo .logo-char-K {
        font-size: 52px;
    }
    .auth-card__logo .logo-char-K {
        left: -21px;
        margin-right: -21px;
    }
}
