* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #000a12;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.background-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background: radial-gradient(ellipse at top, rgba(156, 39, 176, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at bottom, rgba(255, 64, 164, 0.1) 0%, transparent 50%);
}

.background-animation::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(156, 39, 176, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255, 64, 164, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(64, 224, 208, 0.1) 0%, transparent 40%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: linear-gradient(135deg, #9c27b0, #ff40a4);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
}

.login-container {
    background: linear-gradient(145deg, rgba(24, 27, 41, 0.9), rgba(11, 15, 24, 0.85));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(156, 39, 176, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.login-language-corner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 13, 20, 0.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.language-toggle__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 0.55rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.language-toggle__option:hover {
    color: rgba(255, 255, 255, 0.86);
}

.language-toggle__option.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #9c27b0, #ff40a4, transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 0.35rem;
}

.login-logo {
    width: 180px;
    height: auto;
    margin-bottom: 0.75rem;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(156, 39, 176, 0.5));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d1b3ff 0%, #9b5cff 50%, #ff40a4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 400;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.flash-message.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.1));
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff8ca7;
}

.flash-message.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.1));
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #7dffaa;
}

.flash-message::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.1rem;
}

.flash-message.error::before {
    content: '\f06a';
}

.flash-message.success::before {
    content: '\f058';
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    padding-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    transition: transform 0.2s ease;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9c27b0;
    font-size: 1.1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    background: rgba(156, 39, 176, 0.05);
    border: 1.5px solid rgba(156, 39, 176, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    background: rgba(156, 39, 176, 0.1);
    border-color: rgba(156, 39, 176, 0.6);
    box-shadow: 0 0 0 4px rgba(156, 39, 176, 0.1),
                0 8px 24px rgba(156, 39, 176, 0.2);
    transform: translateY(-2px);
}

.form-group input:focus ~ .input-icon {
    color: #ff40a4;
    transform: translateY(-50%) scale(1.1);
}

.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.captcha-display {
    background: linear-gradient(135deg, rgba(11, 15, 24, 0.8), rgba(24, 27, 41, 0.6));
    border: 1.5px solid rgba(156, 39, 176, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.captcha-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(156, 39, 176, 0.1), transparent);
    animation: captchaScan 3s infinite;
}

@keyframes captchaScan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.captcha-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #d1b3ff, #9b5cff, #ff40a4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    user-select: none;
    position: relative;
    filter: drop-shadow(0 0 10px rgba(156, 39, 176, 0.5));
}

.captcha-input {
    padding-left: 1.25rem !important;
}

.login-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, #9c27b0 0%, #d946ef 50%, #ff40a4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.4);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(156, 39, 176, 0.5),
                0 0 30px rgba(255, 64, 164, 0.3);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(156, 39, 176, 0.2);
}

.footer-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.footer-link {
    color: #ff40a4;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #d1b3ff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 1rem;
        max-width: 100%;
    }

    .login-container {
        padding: 2.5rem 2rem;
        border-radius: 20px;
        box-shadow: 
            0 8px 40px rgba(0, 0, 0, 0.6),
            0 0 80px rgba(156, 39, 176, 0.2),
            inset 0 1px 1px rgba(255, 255, 255, 0.05);
    }

    .login-logo {
        width: 150px;
        margin-bottom: 1rem;
    }

    .login-header {
        margin-bottom: 1.25rem;
    }

    .captcha-text {
        font-size: 1.6rem;
        letter-spacing: 6px;
    }

    .captcha-display {
        padding: 1.25rem;
    }

    .login-btn {
        padding: 1.15rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }

    .login-wrapper {
        padding: 1rem 0.75rem;
        display: flex;
        align-items: center;
        min-height: 100vh;
    }

    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 18px;
        width: 100%;
    }

    .login-language-corner {
        top: 0.85rem;
        right: 0.85rem;
    }

    .login-logo {
        width: 130px;
        margin-bottom: 0.75rem;
    }

    .login-header {
        margin-bottom: 1rem;
    }

    .language-toggle__option {
        min-width: 32px;
        height: 26px;
        font-size: 0.64rem;
    }

    .login-form {
        gap: 1.25rem;
    }

    .form-group input {
        padding: 1rem 1rem 1rem 3.25rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .input-icon {
        left: 1.1rem;
        font-size: 1rem;
    }

    .captcha-text {
        font-size: 1.4rem;
        letter-spacing: 5px;
    }

    .captcha-display {
        padding: 1rem;
    }

    .login-btn {
        padding: 1rem;
        font-size: 0.95rem;
        letter-spacing: 0.8px;
        border-radius: 10px;
    }

    .flash-message {
        padding: 0.9rem 1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .flash-message::before {
        font-size: 1rem;
    }

    .login-footer {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }

    .footer-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 375px) {
    .login-container {
        padding: 1.75rem 1.25rem;
    }

    .login-logo {
        width: 120px;
        margin-bottom: 0.5rem;
    }

    .login-header {
        margin-bottom: 0.875rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input {
        padding: 0.95rem 0.95rem 0.95rem 3rem;
        font-size: 0.9rem;
    }

    .input-icon {
        left: 1rem;
        font-size: 0.95rem;
    }

    .captcha-text {
        font-size: 1.2rem;
        letter-spacing: 4px;
    }

    .login-btn {
        padding: 0.95rem;
        font-size: 0.9rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .login-container::before {
        animation: none;
    }

    .particle {
        display: none;
    }

    .form-group input:focus {
        transform: translateY(0);
    }
}
