:root {
    --primary-green: #0d7a3e;
    --primary-green-dark: #0a5f30;
    --primary-green-light: #15a04f;
    --primary-green-gradient: linear-gradient(135deg, #0d7a3e 0%, #0a5f30 100%);
    --secondary-gold: #f5b342;
    --secondary-gold-light: #ffd700;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --shadow-color: rgba(13, 122, 62, 0.25);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    background: #000;
}

.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
}

.background-wrapper .bg-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: blur(12px) brightness(0.35);
    transition: filter 0.3s ease;
}

.background-wrapper .bg-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d7a3e 0%, #0a5f30 40%, #083d1f 100%);
    display: none;
}

.background-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(13, 122, 62, 0.25) 0%,
        rgba(8, 61, 31, 0.45) 40%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    animation: floatParticle linear infinite;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-duration: 25s;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 120px;
    height: 120px;
    right: 15%;
    animation-duration: 30s;
    animation-delay: 3s;
}

.particle:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 50%;
    top: 70%;
    animation-duration: 20s;
    animation-delay: 5s;
}

.particle:nth-child(4) {
    width: 100px;
    height: 100px;
    left: 30%;
    top: 80%;
    animation-duration: 28s;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 70px;
    height: 70px;
    right: 30%;
    top: 10%;
    animation-duration: 22s;
    animation-delay: 7s;
}

.particle:nth-child(6) {
    width: 50px;
    height: 50px;
    left: 70%;
    top: 60%;
    animation-duration: 18s;
    animation-delay: 4s;
}

.particle:nth-child(7) {
    width: 90px;
    height: 90px;
    left: 20%;
    top: 20%;
    animation-duration: 26s;
    animation-delay: 2s;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg) scale(1);
        opacity: 0;
    }
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
    padding: 0 10px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px 40px 40px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--primary-green),
        var(--secondary-gold),
        var(--primary-green)
    );
    background-size: 200% 100%;
    animation: gradientMove 3s ease-in-out infinite;
}

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

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header .logo-wrapper::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(13, 122, 62, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.login-header .logo-wrapper img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(13, 122, 62, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.9);
    background: white;
    padding: 5px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.login-header .logo-wrapper img:hover {
    transform: scale(1.05);
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-green-dark);
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.login-header h1 span {
    color: var(--secondary-gold);
}

.login-header .subtitle {
    color: var(--secondary-gold);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.login-header .subtitle::before,
.login-header .subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--secondary-gold);
}

.login-header .subtitle::before {
    right: calc(100% + 12px);
}

.login-header .subtitle::after {
    left: calc(100% + 12px);
}

.login-header .tagline {
    margin-top: 10px;
    font-size: 13px;
    color: var(--gray);
    font-weight: 400;
}

.login-header .tagline i {
    color: var(--secondary-gold);
    margin-right: 6px;
}

.form-floating {
    margin-bottom: 16px;
}

.form-floating input {
    border-radius: 14px;
    border: 2px solid rgba(233, 236, 239, 0.8);
    transition: all 0.3s ease;
    font-size: 14px;
    background: rgba(248, 249, 250, 0.9);
    padding: 20px 16px 8px;
    height: 58px;
}

.form-floating input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(13, 122, 62, 0.15);
    background: white;
}

.form-floating input:hover {
    border-color: var(--primary-green-light);
}

.form-floating label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
    padding: 16px 16px 8px;
}

.form-floating label i {
    color: var(--primary-green);
    margin-right: 6px;
    opacity: 0.7;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray);
    z-index: 10;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-green);
    background: rgba(13, 122, 62, 0.08);
}

.btn-login {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    background: var(--primary-green-gradient);
    color: white;
    font-weight: 700;
    font-size: 16px;
    border: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

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

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

.btn-login:hover {
    background: linear-gradient(135deg, #0a5f30 0%, #083d1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(13, 122, 62, 0.4);
}

.btn-login:active {
    transform: translateY(0px);
}

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

.form-check-input:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(13, 122, 62, 0.15);
}

.form-check-label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
}

.form-check-label i {
    color: var(--secondary-gold);
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: var(--secondary-gold);
    text-decoration: none;
}

.forgot-link i {
    transition: transform 0.3s ease;
}

.forgot-link:hover i {
    transform: translateX(-3px);
}

.alert-custom {
    border-radius: 14px;
    border: none;
    font-size: 14px;
    padding: 14px 18px;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border-left: 4px solid #22c55e;
}

.attempts-warning {
    font-size: 13px;
    color: #78350f;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-radius: 12px;
    border-left: 4px solid var(--secondary-gold);
    font-weight: 500;
}

.attempts-warning i {
    color: var(--secondary-gold);
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(233, 236, 239, 0.6);
}

.login-footer p {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
    font-weight: 400;
}

.login-footer .footer-brand {
    font-weight: 600;
    color: var(--primary-green);
}

.login-footer .footer-brand i {
    color: var(--secondary-gold);
}

.login-footer .security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--gray);
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(248, 249, 250, 0.7);
    border-radius: 20px;
}

.login-footer .security-badge i {
    color: var(--primary-green);
}

.spinner-border {
    border-color: white;
    border-right-color: transparent;
    border-width: 2px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px 28px;
        border-radius: 20px;
    }
    .login-header h1 {
        font-size: 22px;
    }
    .login-header .logo-wrapper {
        width: 80px;
        height: 80px;
    }
    .login-header .logo-wrapper img {
        width: 80px;
        height: 80px;
    }
    .login-header .logo-wrapper::before {
        width: 100px;
        height: 100px;
    }
    .login-header .subtitle {
        font-size: 12px;
    }
    .login-header .subtitle::before,
    .login-header .subtitle::after {
        width: 12px;
    }
    .form-floating input {
        height: 52px;
        font-size: 13px;
    }
    .btn-login {
        padding: 13px;
        font-size: 15px;
    }
    .login-container {
        padding: 0 5px;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 24px 16px 24px;
    }
    .login-header .logo-wrapper {
        width: 70px;
        height: 70px;
    }
    .login-header .logo-wrapper img {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    .background-wrapper .bg-image {
        filter: blur(8px) brightness(0.3);
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .login-container {
        max-width: 380px;
    }
    .login-card {
        padding: 25px 30px 25px;
    }
    .login-header .logo-wrapper {
        width: 60px;
        height: 60px;
    }
    .login-header .logo-wrapper img {
        width: 60px;
        height: 60px;
    }
    .login-header .logo-wrapper::before {
        width: 80px;
        height: 80px;
    }
    .login-header h1 {
        font-size: 20px;
    }
    .login-header {
        margin-bottom: 16px;
    }
    .form-floating {
        margin-bottom: 10px;
    }
    .form-floating input {
        height: 44px;
        padding: 12px 12px 4px;
        font-size: 13px;
    }
    .btn-login {
        padding: 10px;
        font-size: 14px;
    }
    .login-footer {
        margin-top: 16px;
        padding-top: 12px;
    }
}
