/* STAFF — login page (light theme, цвета портала) */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --portal-dark:     #0f172a;
    --portal-dark-2:   #1e293b;
    --portal-dark-3:   #334155;
    --pi-orange:       #ef7a1c;
    --pi-orange-2:     #f59e0b;
    --pi-orange-dark:  #c2410c;
    --pi-orange-light: #fff7ed;
    --pi-gray-dark:    #0f172a;
    --pi-gray-mid:     #64748b;
    --pi-gray-light:   #e2e8f0;
    --pi-bg:           #eef1f6;
    --pi-white:        #ffffff;
    --pi-text:         #0f172a;
    --pi-border:       #e2e8f0;
    --pi-shadow:       rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--pi-text);
    background: var(--portal-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background — как hero на главной */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 90% 0%, rgba(239, 122, 28, 0.28), transparent 55%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(59, 130, 246, 0.15), transparent 50%),
        linear-gradient(160deg, var(--portal-dark) 0%, var(--portal-dark-2) 50%, var(--portal-dark-3) 100%);
}

.login-bg::before,
.login-bg::after {
    display: none;
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 20%, black 10%, transparent 75%);
    opacity: 0.55;
}

/* Layout */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 48px;
}

/* Error alert */
.login-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 48px 14px 20px;
    background: #fff5f5;
    border-bottom: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 12px rgba(185, 28, 28, 0.08);
    animation: loginSlideDown 0.4s ease;
}

.login-alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #dc2626;
}

.login-alert__close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.login-alert__close:hover {
    background: rgba(185, 28, 28, 0.15);
}

@keyframes loginSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Card */
.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    background: var(--pi-white);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 20px 48px rgba(0, 0, 0, 0.28);
    animation: loginCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-card__inner {
    padding: 44px 40px 36px;
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Brand / logo */
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand__logo-img {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto 16px;
}

.login-brand__divider {
    width: 36px;
    height: 3px;
    margin: 0 auto 14px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--pi-orange) 0%, var(--pi-orange-2) 100%);
}

.login-brand__portal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-brand__portal-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--pi-gray-mid);
    letter-spacing: 0.01em;
}

.login-brand__portal-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #fff;
    background: linear-gradient(135deg, var(--pi-orange) 0%, var(--pi-orange-2) 100%);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(239, 122, 28, 0.35);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pi-gray-mid);
}

.login-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field__icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--pi-gray-mid);
    pointer-events: none;
    transition: color 0.2s;
}

.login-field__wrap:focus-within .login-field__icon {
    color: var(--pi-orange);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--pi-border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--pi-text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: none;
    margin: 0;
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
    color: #94a3b8;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: rgba(239, 122, 28, 0.65);
    background: var(--pi-white);
    box-shadow: 0 0 0 3px rgba(239, 122, 28, 0.16);
}

/* Submit */
.login-submit {
    margin-top: 6px;
}

.login-submit button {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pi-orange) 0%, var(--pi-orange-2) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    float: none;
    margin: 0;
    box-shadow: 0 4px 16px rgba(239, 122, 28, 0.35);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    position: relative;
    overflow: hidden;
}

.login-submit button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.login-submit button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(239, 122, 28, 0.4);
    filter: brightness(1.03);
    background: linear-gradient(135deg, var(--pi-orange) 0%, var(--pi-orange-2) 100%);
}

.login-submit button:hover::before {
    opacity: 1;
}

.login-submit button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(239, 122, 28, 0.25);
    background: linear-gradient(135deg, var(--pi-orange) 0%, var(--pi-orange-2) 100%);
}

/* Forgot password */
.login-forgot {
    margin: 24px 0 0;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--pi-gray-mid);
}

.login-wrapper > .login-forgot {
    color: #94a3b8;
}

.login-forgot a {
    color: var(--pi-orange-dark);
    text-decoration: none;
    border-bottom: 1px solid rgba(239, 122, 28, 0.35);
    transition: color 0.2s, border-color 0.2s;
}

.login-wrapper > .login-forgot a {
    color: #fbbf24;
    border-bottom-color: rgba(251, 191, 36, 0.35);
}

.login-forgot a:hover {
    color: var(--pi-orange);
    border-color: var(--pi-orange);
}

.login-wrapper > .login-forgot a:hover {
    color: #fcd34d;
    border-color: #fcd34d;
}

/* Page title (recovery etc.) */
.login-page-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--pi-gray-dark);
    text-align: center;
}

/* Status message */
.login-message {
    margin: 0 0 8px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--pi-text);
    text-align: center;
    background: #f8fafc;
}

.login-message--error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.login-message--success {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

/* Footer */
.login-footer {
    margin-top: 28px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

.login-wrapper > .login-footer {
    color: #64748b;
}

/* Captcha (preserved) */
.login-captcha {
    margin-top: 4px;
}

.login-captcha__img {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pi-border);
}

.login-captcha__hint {
    margin: 8px 0 6px;
    font-size: 12px;
    color: var(--pi-gray-mid);
}

.login-captcha__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-captcha__row input {
    flex: 1;
    padding-left: 16px !important;
}

.login-captcha__reload {
    cursor: pointer;
    width: 35px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.login-captcha__reload:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card__inner {
        padding: 32px 24px 28px;
    }

    .login-brand__logo-img {
        max-width: 220px;
    }
}
