/**
 * app.css
 * Additional styles for the App page
 */

/* ===== CONTAINER PRINCIPALE ===== */
.app-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-top: 70px;
    background: var(--primary);
}

.app-content {
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

/* ===== LOGO ===== */
.app-logo {
    margin-bottom: 40px;
}

.app-logo img {
    max-width: 130px;
    height: auto;
    transition: transform 0.3s ease;
}

.app-logo img:hover {
    transform: scale(1.02);
}

/* ===== TITOLI ===== */
.app-title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

.app-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* ===== FORM DI LOGIN ===== */
.app-login-form {
    margin-bottom: 30px;
}

#csml-login-form {
    width: 100%;
}

.csml-login-field {
    margin-bottom: 20px;
    text-align: left;
}

.csml-login-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--light);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.csml-login-field input[type="text"],
.csml-login-field input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 4px;
    color: var(--light);
    font-family: var(--font-body);
    font-size: 16px;
    transition: all var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.csml-login-field input[type="text"]:hover,
.csml-login-field input[type="password"]:hover {
    border-color: rgba(0, 180, 216, 0.6);
}

.csml-login-field input[type="text"]:focus,
.csml-login-field input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1), 0 2px 10px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.csml-login-field input::placeholder {
    color: rgba(149, 165, 166, 0.5);
    font-size: 14px;
}

.csml-login-remember {
    margin-bottom: 25px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csml-login-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    margin: 0;
}

.csml-login-remember label {
    color: var(--gray);
    font-size: 14px;
    cursor: pointer;
    transition: color var(--transition);
}

.csml-login-remember label:hover {
    color: var(--light);
}

.csml-login-submit {
    margin-top: 10px;
}

.csml-login-submit .btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 14px;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.csml-login-submit .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.csml-login-submit .btn:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.25);
}

.csml-login-submit .btn:hover::before {
    width: 300px;
    height: 300px;
}

.csml-login-submit .btn span {
    position: relative;
    z-index: 1;
}

/* Link per recupero password (nascosto di default) */
.csml-login-lost-password {
    text-align: right;
    margin-top: 10px;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.csml-login-lost-password:hover {
    opacity: 1;
}

.csml-login-lost-password a {
    color: var(--secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color var(--transition);
    border-bottom: 1px dotted transparent;
}

.csml-login-lost-password a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== POLICY LINKS MINIMALE ===== */
.app-policy {
    margin-top: 40px;
    font-size: 12px;
    color: rgba(149, 165, 166, 0.4);
}

.app-policy a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 2px;
}

.app-policy a:hover {
    color: var(--accent);
    background: rgba(255, 215, 0, 0.05);
}

.policy-separator {
    margin: 0 10px;
    color: rgba(149, 165, 166, 0.2);
}

/* ===== MESSAGGI DI ERRORE/SUCCESSO ===== */
.login-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

.login-message.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.login-message.success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-title {
        font-size: 28px;
    }
    
    .app-subtitle {
        font-size: 16px;
    }
    
    .app-subtitle br {
        display: none;
    }
    
    .app-logo img {
        max-width: 110px;
    }
    
    .csml-login-field input[type="text"],
    .csml-login-field input[type="password"] {
        padding: 14px 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 20px 15px;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .app-logo img {
        max-width: 100px;
    }
    
    .app-logo {
        margin-bottom: 30px;
    }
    
    .app-subtitle {
        margin-bottom: 30px;
    }
    
    .csml-login-field input[type="text"],
    .csml-login-field input[type="password"] {
        padding: 12px 16px;
    }
    
    .csml-login-submit .btn {
        padding: 14px 20px;
        font-size: 13px;
    }
    
    .policy-separator {
        margin: 0 5px;
    }
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Applica pulse al bottone al focus per accessibilità */
.csml-login-submit .btn:focus {
    animation: pulse 1s infinite;
}

/* ===== SUPPORTO PER RIDOTTA ANIMAZIONE ===== */
@media (prefers-reduced-motion: reduce) {
    .app-content,
    .app-logo img,
    .csml-login-field input,
    .csml-login-submit .btn,
    .csml-login-submit .btn::before {
        animation: none;
        transition: none;
    }
    
    .csml-login-submit .btn:hover {
        transform: none;
    }
}