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

body {
    background: linear-gradient(-45deg, #667eea, #764ba2, #6a11cb, #2575fc);
    background-size: 300% 300%;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: gradientShift 12s ease infinite;
}

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

body::before,
body::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

body::before {
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

body::after {
    bottom: -200px;
    right: -200px;
    animation-delay: 4s;
}

body {
    position: relative;
}

body:has(.login-container)::after {
    content: "";
    position: absolute;
    top: 20%;
    right: 10%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 12s ease-in-out infinite reverse;
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.7;
    }

    25% {
        transform: translateY(-30px) rotate(90deg) scale(1.1);
        opacity: 0.9;
    }

    50% {
        transform: translateY(-20px) rotate(180deg) scale(0.9);
        opacity: 0.6;
    }

    75% {
        transform: translateY(-40px) rotate(270deg) scale(1.05);
        opacity: 0.8;
    }
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    animation: slideUp 0.8s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.login-logo i {
    font-size: 2rem;
    color: white;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #718096;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.75rem;
    position: relative;
    transition: transform 0.3s ease;
}

.form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.form-group:focus-within .form-label {
    color: #667eea;
}

.form-control {
    width: 100%;
    padding: 1.1rem 1.1rem 1.1rem 3.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(247, 250, 252, 0.9);
    backdrop-filter: blur(15px);
    position: relative;
    line-height: 1.5;
    color: #2d3748;
}

.form-control::placeholder {
    color: #a0aec0;
    font-weight: 400;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow:
        0 0 0 3px rgba(102, 126, 234, 0.12),
        0 4px 12px rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
    background: #fff;
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-control.is-valid {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.form-control.is-invalid {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

.password-strength {
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(247, 250, 252, 0.9);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.3s ease;
    position: relative;
    z-index: 3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.requirement {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    font-size: 0.82rem;
    transition: all 0.3s ease;
}

.req-icon {
    margin-right: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.requirement.met {
    color: #48bb78;
}

.requirement.met .req-icon {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.requirement.unmet {
    color: #a0aec0;
}

.invalid-feedback {
    color: #e53e3e;
    font-size: 0.82rem;
    margin-top: 0.6rem;
    display: none;
    animation: shake 0.5s ease;
    padding-left: 0.5rem;
    position: relative;
    z-index: 3;
    line-height: 1.4;
    font-weight: 500;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.btn-login {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.25),
        0 3px 10px rgba(102, 126, 234, 0.15);
    margin-top: 0.75rem;
    letter-spacing: 0.03em;
}

.btn-login::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: left 0.6s ease;
}

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

.btn-login:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 15px 40px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.btn-login:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alert-danger {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    border-left: 4px solid #f56565;
}

.form-text {
    color: #718096;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 2.5rem 2rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-logo {
        width: 70px;
        height: 70px;
    }

    .form-control {
        padding: 1rem 1rem 1rem 3rem;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 1.1rem;
        font-size: 1rem;
        top: 3.25rem;
    }

    .btn-login {
        padding: 1.1rem;
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: 1.75rem;
    }

    .password-strength {
        padding: 1rem;
        margin-top: 0.75rem;
    }

    .requirement {
        margin: 0.6rem 0;
        font-size: 0.8rem;
    }

    .req-icon {
        margin-right: 0.6rem;
        width: 14px;
        height: 14px;
        font-size: 0.8rem;
    }
}

.form-group {
    position: relative;
}

.form-group::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0);
    transition: background 0.4s ease;
    z-index: 0;
    border-radius: 16px;
    pointer-events: none;
}

.form-group:focus-within::before {
    background: rgba(102, 126, 234, 0.03);
}

.input-icon {
    position: absolute;
    top: 3.45rem;
    left: 1.25rem;
    transform: translateY(-50%);
    color: #a0aec0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.form-control:focus+.input-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.15);
}

.form-control.is-valid+.input-icon {
    color: #48bb78;
    animation: iconSuccess 0.6s ease;
}

.form-control.is-invalid+.input-icon {
    color: #f56565;
    animation: iconError 0.6s ease;
}

@keyframes iconSuccess {
    0% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.4);
    }

    100% {
        transform: translateY(-50%) scale(1.15);
    }
}

@keyframes iconError {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    25% {
        transform: translateY(-50%) translateX(-4px);
    }

    75% {
        transform: translateY(-50%) translateX(4px);
    }
}

.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.form-control:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.alert {
    border-radius: 16px;
    border: none;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    animation: alertSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.3;
}

@keyframes alertSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    60% {
        opacity: 0.8;
        transform: translateY(5px) scale(1.02);
    }

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

@media (max-width: 480px) {

    input[type="text"],
    input[type="password"],
    textarea {
        font-size: 16px !important;
    }

    .form-group {
        margin-bottom: 1.8rem;
    }

    .form-control:focus {
        transform: translateY(-2px) scale(1.01);
    }

    .btn-login {
        min-height: 52px;
        font-size: 1.1rem;
    }

    .login-container {
        animation-duration: 0.6s;
    }

    .login-logo {
        animation-duration: 2s;
    }
}

@media (hover: none) and (pointer: coarse) {
    .form-control:hover {
        transform: none;
    }

    .btn-login:hover {
        transform: none;
    }

    .form-control:focus {
        transform: scale(1.01);
    }

    .btn-login:active {
        transform: scale(0.98);
    }
}

@media (prefers-contrast: high) {
    .login-container {
        border: 2px solid #000;
        background: #fff;
    }

    .form-control {
        border-width: 2px;
    }

    .btn-login {
        border: 2px solid #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-logo {
        animation: none;
    }

    body::before,
    body::after {
        animation: none;
    }

    .login-container {
        animation: none;
        opacity: 1;
        transform: none;
    }
}