/* ═══════════════════════════════════════════════════════════════
   BUMAGA SERVICE — Auth Pages Shared Styles v1.0
   ═══════════════════════════════════════════════════════════════

   Used by: login.php, register.php
   Depends on: tokens.css (loaded via header.php)

   Design decisions (PR-0):
     • Blue gradient CTA on both pages (was green→blue on register)
     • Blue top-border on both pages (was green→blue on register)
     • Unified border-radius: 12px (was 10px on login)
     • Unified max-width: 440px (was 420px on register)
     • Dark inputs (#1a1a1a) matching cabinet style

   ═══════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════
   1. LAYOUT
   ═══════════════════════════════════════════════ */

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

.auth-card {
    background: linear-gradient(145deg, #1e1e1e 0%, #252525 100%);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Animated blue top-border (unified — was green on register) */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00a2ff, #0066ff, #00a2ff);
    background-size: 200% 100%;
    animation: authGradientMove 3s ease infinite;
}

@keyframes authGradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


/* ═══════════════════════════════════════════════
   2. HEADER
   ═══════════════════════════════════════════════ */

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-logo {
    font-size: 42px;
    margin-bottom: 10px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-subtitle {
    color: #888;
    font-size: 14px;
}


/* ═══════════════════════════════════════════════
   3. TELEGRAM LOGIN
   ═══════════════════════════════════════════════ */

.telegram-login-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.btn-telegram {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.4);
}

.btn-telegram svg {
    width: 24px;
    height: 24px;
}


/* ═══════════════════════════════════════════════
   4. DIVIDER
   ═══════════════════════════════════════════════ */

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #555;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

.divider span {
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ═══════════════════════════════════════════════
   5. FORM ELEMENTS
   ═══════════════════════════════════════════════ */

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    color: #b0b0b0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-label .optional {
    color: #555;
    font-weight: 400;
    text-transform: none;
    font-size: 11px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #00a2ff;
    box-shadow: 0 0 20px rgba(0, 162, 255, 0.2);
}

.form-input::placeholder {
    color: #555;
}

.form-input.error {
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

.form-input.success {
    border-color: #00c853;
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.2);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
}

.input-icon:hover {
    color: #00a2ff;
}

/* Status indicator (register: username check, password match) */
.input-status {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

/* Input hint text (register: "Латинские буквы, цифры, _") */
.input-hint {
    font-size: 12px;
    color: #555;
    margin-top: 6px;
}

.input-hint.error {
    color: #ff6b6b;
}

.input-hint.success {
    color: #00c853;
}


/* ═══════════════════════════════════════════════
   6. PASSWORD STRENGTH (register)
   ═══════════════════════════════════════════════ */

.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak   { width: 25%;  background: #ff4444; }
.strength-fill.fair   { width: 50%;  background: #ff9800; }
.strength-fill.good   { width: 75%;  background: #ffeb3b; }
.strength-fill.strong { width: 100%; background: #00c853; }


/* ═══════════════════════════════════════════════
   7. CHECKBOX (login: "Remember me")
   ═══════════════════════════════════════════════ */

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: #00a2ff;
    cursor: pointer;
}

.checkbox-label {
    color: #888;
    font-size: 14px;
    cursor: pointer;
}


/* ═══════════════════════════════════════════════
   8. SUBMIT BUTTON (unified blue gradient)
   ═══════════════════════════════════════════════ */

.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #00a2ff 0%, #0066ff 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 162, 255, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
    margin-right: 10px;
}

.btn-submit.loading .spinner {
    display: inline-block;
}

.btn-submit.loading .btn-text {
    opacity: 0.7;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════
   9. FOOTER (auth page — "Нет аккаунта?" / "Уже есть?")
   ═══════════════════════════════════════════════ */

.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #333;
}

.auth-footer p {
    color: #888;
    font-size: 14px;
}

.auth-footer a {
    color: #00a2ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.auth-footer a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 162, 255, 0.5);
}


/* ═══════════════════════════════════════════════
   10. MESSAGES (error + success)
   ═══════════════════════════════════════════════ */

.error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 22px;
    color: #ff6b6b;
    font-size: 14px;
    display: none;
}

.error-message.visible {
    display: block;
    animation: authShake 0.5s ease;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success-message {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 22px;
    color: #00c853;
    font-size: 14px;
    display: none;
}

.success-message.visible {
    display: block;
}


/* ═══════════════════════════════════════════════
   11. FORGOT PASSWORD LINK (login)
   ═══════════════════════════════════════════════ */

.forgot-link {
    text-align: right;
    margin-top: -12px;
    margin-bottom: 22px;
}

.forgot-link a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-link a:hover {
    color: #00a2ff;
}


/* ═══════════════════════════════════════════════
   12. MOBILE ADAPTATION
   ═══════════════════════════════════════════════ */

/* ── Tablet / small desktop ── */
@media (max-width: 600px) {
    .auth-container {
        padding: 20px 14px;
        min-height: calc(100vh - 160px);
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-logo {
        font-size: 32px;
        margin-bottom: 6px;
    }

    .auth-title {
        font-size: 22px;
        letter-spacing: 1.5px;
        margin-bottom: 6px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .telegram-login-container {
        margin-bottom: 0;
    }

    .btn-telegram {
        padding: 13px;
        font-size: 15px;
        border-radius: 10px;
        gap: 10px;
    }

    .btn-telegram svg {
        width: 20px;
        height: 20px;
    }

    .divider {
        margin: 18px 0;
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 6px;
        letter-spacing: 0.8px;
    }

    .form-input {
        padding: 13px 16px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        border-radius: 10px;
    }

    .input-hint {
        font-size: 11px;
        margin-top: 4px;
    }

    .forgot-link {
        margin-top: -8px;
        margin-bottom: 16px;
    }

    .checkbox-group {
        margin-bottom: 18px;
        gap: 8px;
    }

    .checkbox-input {
        width: 18px;
        height: 18px;
    }

    .checkbox-label {
        font-size: 13px;
    }

    .btn-submit {
        padding: 14px;
        font-size: 15px;
        border-radius: 10px;
        letter-spacing: 1.5px;
    }

    .auth-footer {
        margin-top: 20px;
        padding-top: 18px;
    }

    .auth-footer p {
        font-size: 13px;
    }

    /* Messages */
    .error-message,
    .success-message {
        padding: 12px;
        margin-bottom: 16px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* Password strength */
    .password-strength {
        margin-top: 6px;
    }
}

/* ── Small phones ── */
@media (max-width: 400px) {
    .auth-container {
        padding: 16px 10px;
    }

    .auth-card {
        padding: 26px 18px;
        border-radius: 14px;
    }

    .auth-header {
        margin-bottom: 20px;
    }

    .auth-logo {
        font-size: 28px;
        margin-bottom: 4px;
    }

    .auth-title {
        font-size: 20px;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }

    .auth-subtitle {
        font-size: 12px;
    }

    .btn-telegram {
        padding: 12px;
        font-size: 14px;
    }

    .divider {
        margin: 14px 0;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-input {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .btn-submit {
        padding: 13px;
        font-size: 14px;
    }

    .auth-footer {
        margin-top: 16px;
        padding-top: 14px;
    }
}
