/* -------------------------------------------------------------
   Adotta un Albero - Accesso Area Riservata Style Sheet
   Premium Frosted Glassmorphism Design
   ------------------------------------------------------------- */

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

:root {
    --primary: #52BC21;
    --primary-hover: #3a9118;
    --primary-glow: rgba(82, 188, 33, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(0, 0, 0, 0.35);
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --error-color: #ff6b6b;
    --error-bg: rgba(255, 107, 107, 0.12);
}

html {
    height: 100%;
    background: #0f1c0d; /* deep green fallback */
    overflow: hidden;
}

body {
    height: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    background: transparent;
}

/* Background image handling with clean dark overlay */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dark-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.65) 100%);
    backdrop-filter: blur(2px);
}

/* Main Flex Container */
.main-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Elegant glassmorphic card box */
.loginBox {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 15px 35px 0 var(--glass-shadow);
    padding: 45px 35px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: boxAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Logo badge at the top */
.logo-badge {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
    text-transform: uppercase;
    background: rgba(82, 188, 33, 0.12);
    border: 1px solid rgba(82, 188, 33, 0.25);
    padding: 6px 14px;
    border-radius: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.logo-badge:hover {
    background: rgba(82, 188, 33, 0.2);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-1px);
}

/* Typography styles */
.loginBox h2 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

.loginBox p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 35px;
}

/* Form structure */
#loginForm {
    width: 100%;
    text-align: left;
}

.input-group {
    margin-bottom: 22px;
    position: relative;
}

.label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Input Fields */
.loginBox input[type="text"],
.loginBox input[type="password"] {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 0.98rem;
    font-family: inherit;
    color: var(--text-white);
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.loginBox input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.loginBox input:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
}

.loginBox input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Premium Submit Button */
.btn-submit {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--text-white);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 15px;
    box-shadow: 0 5px 15px rgba(82, 188, 33, 0.35);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(82, 188, 33, 0.5);
    filter: brightness(1.05);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(82, 188, 33, 0.3);
}

/* Elegant warning/error styles */
.error-message {
    color: var(--error-color);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--error-bg);
    border-left: 3px solid var(--error-color);
    animation: shake 0.4s ease-in-out;
}

.error-center {
    margin-top: 18px;
    text-align: center;
    border-left: none;
    border-top: 2px solid var(--error-color);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Form footer links */
.login-footer {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.back-home-link {
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0.65;
    transition: all 0.2s ease;
}

.back-home-link:hover {
    opacity: 1;
    color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .loginBox {
        padding: 35px 22px;
    }
}