* { margin: 0; padding: 0; box-sizing: border-box; }

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}


@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}

:root {
    --date: #7B5E4A;
    --date-dark: #5C4435;
    --date-light: #A0846D;
    --beige: #F5F0E8;
    --cream: #FAF7F2;
    --terracotta: #C67B5C;
    --terracotta-dark: #A85E3E;
    --blue: #5B8FA8;
    --blue-light: #7AABBF;
    --purple: #8B7AA8;
    --purple-light: #A99BC0;
    --success: #4CAF7D;
    --error: #D95A5A;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow: hidden;
    background: var(--cream);
    color: var(--date-dark);
}

/* ===== PARALLAX BACKGROUND ===== */
.parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FAF7F2 0%, #F5F0E8 30%, #EDE4D8 60%, #E8DDD0 100%);
}

.factory-silhouettes {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.factory-silhouettes svg {
    position: absolute;
    bottom: 0;
    opacity: 0.08;
}

.factory-left {
    left: -2%;
    height: 65%;
}

.factory-center {
    left: 30%;
    height: 50%;
}

.factory-right {
    right: -2%;
    height: 70%;
}

.pipes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pipes-layer svg {
    position: absolute;
    opacity: 0.12;
}

.pipe-top {
    top: 5%;
    left: 0;
    width: 100%;
    height: 80px;
}

.pipe-bottom {
    bottom: 15%;
    left: 0;
    width: 100%;
    height: 60px;
}

.pipe-diagonal {
    top: 20%;
    right: 5%;
    width: 300px;
    height: 400px;
    opacity: 0.06;
}

.gears-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gear {
    position: absolute;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.gear-1 {
    top: 10%;
    left: 8%;
    width: 120px;
    height: 120px;
    opacity: 0.1;
    animation: spin 20s linear infinite;
}

.gear-2 {
    top: 60%;
    right: 10%;
    width: 160px;
    height: 160px;
    opacity: 0.08;
    animation: spin-reverse 25s linear infinite;
}

.gear-3 {
    bottom: 25%;
    left: 15%;
    width: 90px;
    height: 90px;
    opacity: 0.09;
    animation: spin 15s linear infinite;
}

.gear-4 {
    top: 15%;
    right: 20%;
    width: 70px;
    height: 70px;
    opacity: 0.12;
    animation: spin-reverse 18s linear infinite;
}

.gear-5 {
    top: 50%;
    left: 3%;
    width: 100px;
    height: 100px;
    opacity: 0.07;
    animation: spin 22s linear infinite;
}

.gear-6 {
    bottom: 10%;
    right: 25%;
    width: 80px;
    height: 80px;
    opacity: 0.11;
    animation: spin-reverse 16s linear infinite;
}

.gear-7 {
    top: 80%;
    left: 45%;
    width: 60px;
    height: 60px;
    opacity: 0.06;
    animation: spin 14s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

.particles-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ===== LOGIN CARD ===== */
.login-card {
    width: 100%;
    max-width: 440px;
    max-height: 700px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px 40px;
    box-shadow:
        0 25px 60px rgba(92, 68, 53, 0.15),
        0 8px 20px rgba(92, 68, 53, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(123, 94, 74, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--terracotta), var(--date), var(--purple), var(--blue));
    border-radius: 24px 24px 0 0;
}

.login-card.shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    50%,
    90% {
        transform: translateX(-8px);
    }

    30%,
    70% {
        transform: translateX(8px);
    }
}

.login-card.success {
    animation: success-pulse 0.6s ease;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.logo-area {
    text-align: center;
    margin-bottom: 8px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--terracotta), var(--date));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(198, 123, 92, 0.3);
    animation: logo-rotate 8s ease-in-out infinite;
}

@keyframes logo-rotate {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(3deg) scale(1.02);
    }

    75% {
        transform: rotate(-3deg) scale(1.02);
    }
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.logo-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--date-dark);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 13px;
    color: var(--date-light);
    margin-top: 2px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--date);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--date-light);
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 13px 16px 13px 48px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--date-dark);
    background: rgba(245, 240, 232, 0.6);
    border: 2px solid rgba(123, 94, 74, 0.15);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--date-light);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--terracotta);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(198, 123, 92, 0.12);
}

.form-input:focus~.input-icon,
.form-input:focus+.input-icon {
    color: var(--terracotta);
}

.form-input.error {
    border-color: var(--error);
    background: rgba(217, 90, 90, 0.05);
    box-shadow: 0 0 0 4px rgba(217, 90, 90, 0.08);
}

.form-input.success-field {
    border-color: var(--success);
    background: rgba(76, 175, 125, 0.05);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(217, 90, 90, 0.08);
    border-radius: 8px;
    border-left: 3px solid var(--error);
    font-size: 13px;
    color: var(--error);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.error-message svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.alert-banner.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.alert-banner.alert-error {
    background: linear-gradient(135deg, rgba(217, 90, 90, 0.1), rgba(217, 90, 90, 0.05));
    color: var(--error);
    border: 1px solid rgba(217, 90, 90, 0.2);
}

.alert-banner.alert-success {
    background: linear-gradient(135deg, rgba(76, 175, 125, 0.1), rgba(76, 175, 125, 0.05));
    color: var(--success);
    border: 1px solid rgba(76, 175, 125, 0.2);
}

.alert-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--date-light);
    padding: 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--terracotta);
    background: rgba(198, 123, 92, 0.1);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(123, 94, 74, 0.25);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.custom-checkbox svg {
    width: 10px;
    height: 10px;
    fill: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked+.custom-checkbox {
    background: var(--terracotta);
    border-color: var(--terracotta);
    box-shadow: 0 2px 8px rgba(198, 123, 92, 0.3);
}

.checkbox-wrapper input:checked+.custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-text {
    font-size: 13px;
    color: var(--date-light);
    font-weight: 500;
}

.forgot-link {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--terracotta-dark);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: white;
    background: linear-gradient(135deg, var(--terracotta), var(--date));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(198, 123, 92, 0.3);
    letter-spacing: 0.3px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(198, 123, 92, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:active::after {
    width: 400px;
    height: 400px;
}

.submit-btn .btn-text {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn .btn-text svg {
    width: 18px;
    height: 18px;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: none;
}

.submit-btn.loading .spinner {
    opacity: 1;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.corner-decor {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0.1;
}

.corner-decor.top-left {
    top: 12px;
    left: 12px;
    border-top: 3px solid var(--terracotta);
    border-left: 3px solid var(--terracotta);
    border-radius: 8px 0 0 0;
}

.corner-decor.bottom-right {
    bottom: 12px;
    right: 12px;
    border-bottom: 3px solid var(--purple);
    border-right: 3px solid var(--purple);
    border-radius: 0 0 8px 0;
}

.form-group:focus-within .input-icon {
    color: var(--terracotta);
    transform: translateY(-50%) scale(1.1);
    transition: all 0.3s ease;
}

.form-group,
.form-options,
.submit-btn,
.logo-area {
    opacity: 0;
    transform: translateY(15px);
    animation: fade-in-up 0.5s ease forwards;
}

.logo-area {
    animation-delay: 0.05s;
}

.form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.form-options {
    animation-delay: 0.3s;
}

.submit-btn {
    animation-delay: 0.4s;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== OVERLAY ANIMATIONS ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 68, 53, 0.4);
    backdrop-filter: blur(8px);
}

.overlay-content {
    position: relative;
    z-index: 2;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay.active .overlay-content {
    transform: scale(1);
}

.success-overlay .overlay-bg {
    background: rgba(76, 175, 125, 0.3);
}

.success-icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #3DA86A);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 40px rgba(76, 175, 125, 0.4);
    animation: success-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes success-bounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.success-icon-circle svg {
    width: 44px;
    height: 44px;
    fill: white;
    animation: check-draw 0.5s ease 0.3s both;
}

@keyframes check-draw {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.overlay-title {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.overlay-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
}

.error-overlay .overlay-bg {
    background: rgba(217, 90, 90, 0.3);
}

.error-icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--error), #C04545);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 40px rgba(217, 90, 90, 0.4);
    animation: error-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes error-bounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.error-icon-circle svg {
    width: 44px;
    height: 44px;
    fill: white;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 101;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg) scale(0);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .logo-title {
        font-size: 20px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
/* === FIX: input не вылезает за границы карточки === */
.login-card {
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.form-group {
    width: 100%;
    min-width: 0;
}

.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
}

.input-icon {
    position: absolute;
    left: 0.8rem;
    pointer-events: none;
    flex-shrink: 0;
}

.password-toggle {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

/* На всякий случай — запрет горизонтального скролла */
html, body {
    overflow-x: hidden;
}