@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --primary-red: #e53935;
    --primary-red-hover: #f0524e;
    --bg-dark: #07090e;
    --card-bg: rgba(20, 23, 30, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #8e95a5;
    --input-bg: rgba(255, 255, 255, 0.04);
}

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

body,
html {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Background Effects */
.auth-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05070a;
    padding: 20px;
    overflow: hidden;
}

/* 3D Grid Pattern */
.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    perspective: 1000px;
    transform: perspective(600px) rotateX(60deg) translateY(-100px) scale(3);
    pointer-events: none;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
}

/* Glowing Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 2;
    animation: float 12s infinite alternate ease-in-out;
    opacity: 0.8;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    max-width: 800px;
    max-height: 800px;
    background: rgba(229, 57, 53, 0.3);
    top: -20%;
    left: -10%;
}

.orb-2 {
    width: 40vw;
    height: 40vw;
    max-width: 700px;
    max-height: 700px;
    background: rgba(229, 57, 53, 0.35);
    bottom: -15%;
    right: -10%;
    animation-delay: -6s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Content Container */
.auth-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 460px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section img {
    height: 90px;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.logo-section img:hover {
    transform: scale(1.05) translateY(-5px);
}

/* Card */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

/* Typography */
.auth-card h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #a5b0c0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 28px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 22px;
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px 18px 18px 54px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.input-control::placeholder {
    color: transparent;
}

/* Floating Label */
.floating-label {
    position: absolute;
    left: 54px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.input-control:focus,
.input-control:not(:placeholder-shown) {
    background: rgba(229, 57, 53, 0.03);
    border-color: rgba(229, 57, 53, 0.4);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(229, 57, 53, 0.1);
}

.input-control:focus+.floating-label,
.input-control:not(:placeholder-shown)+.floating-label {
    top: -10px;
    left: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-red);
    background: #090c12;
    /* Match underlying dark to obscure borders */
    padding: 0 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.input-control:focus~.input-icon {
    color: var(--primary-red);
}

/* Button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-red) 0%, #b71c1c 100%);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 18px;
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(229, 57, 53, 0.3);
    letter-spacing: 0.5px;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px rgba(229, 57, 53, 0.4);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px rgba(229, 57, 53, 0.3);
}

/* Error Alert */
.error-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(229, 57, 53, 0.15);
    border: 1px solid rgba(229, 57, 53, 0.3);
    color: #ffb4ab;
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    margin-bottom: 28px;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

/* Captcha */
.captcha-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

/* Footer Section */
.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
}

.lang-switch-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lang-switch-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.lang-switch-btn .lang-badge {
    background: var(--primary-red);
    color: #fff;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.copyright {
    color: rgba(142, 149, 165, 0.4);
    font-size: 13px;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 35px 20px;
        border-radius: 24px;
    }

    .auth-card h1 {
        font-size: 26px;
    }

    .logo-section img {
        height: 60px;
    }

    .auth-content {
        padding: 0;
    }
}

/* Optimization for short screens (laptops) */
@media (max-height: 800px) {
    .logo-section {
        margin-bottom: 20px;
    }

    .logo-section img {
        height: 70px;
    }

    .auth-card {
        padding: 35px 30px;
    }

    .subtitle {
        margin-bottom: 30px;
    }
}

@media (max-height: 650px) {
    .logo-section {
        margin-bottom: 15px;
    }

    .logo-section img {
        height: 60px;
    }

    .auth-card {
        padding: 25px 30px;
    }

    .subtitle {
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}