/* assets/css/login.css - Stili per login e registrazione */

/* Layout Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7692bc 0%, #0082d5 100%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease-out;
}

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

.auth-header {
    background: #e0e0e0;
    color: rgb(77, 77, 77);
    padding: 30px 20px 20px;
    text-align: center;
}

.auth-logo {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.auth-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-body {
    padding: 30px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group.has-icon {
    position: relative;
}

.form-group.has-icon .form-input {
    padding-left: 45px;
}

.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-input.success {
    border-color: var(--success-color);
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

.form-error.show {
    display: block;
    animation: fadeInDown 0.3s ease-out;
}

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

.form-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

.form-success.show {
    display: block;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-weak .strength-fill {
    width: 33%;
    background: var(--error-color);
}

.strength-medium .strength-fill {
    width: 66%;
    background: var(--warning-color);
}

.strength-strong .strength-fill {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Remember Me */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.remember-me label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

/* Auth Actions */
.auth-actions {
    margin-bottom: 20px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

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

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn.loading {
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Auth Links */
.auth-links {
    text-align: center;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-light);
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

/* Forgot Password */
.forgot-password {
    text-align: center;
    margin-bottom: 20px;
}

.forgot-password a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Social Login (per future implementazioni) */
.social-login {
    margin-bottom: 20px;
}

.social-btn {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: rgba(76, 175, 80, 0.05);
}

.social-btn:last-child {
    margin-bottom: 0;
}

/* Terms and Privacy */
.terms-privacy {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
    margin-top: 20px;
}

.terms-privacy a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-privacy a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.auth-loading.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success Message */
.success-message {
    background: var(--success-color);
    color: white;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error Message */
.error-message {
    background: var(--error-color);
    color: white;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(-5px);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Login Attempts Warning */
.login-attempts {
    background: var(--warning-color);
    color: white;
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.login-attempts.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        margin: 10px;
        border-radius: 10px;
    }
    
    .auth-header {
        padding: 25px 15px 15px;
    }
    
    .auth-logo {
        font-size: 2rem;
    }
    
    .auth-title {
        font-size: 1.3rem;
    }
    
    .auth-body {
        padding: 20px 15px;
    }
    
    .form-input {
        padding: 12px;
        font-size: 16px; /* Previene zoom su iOS */
    }
    
    .form-group.has-icon .form-input {
        padding-left: 40px;
    }
    
    .form-icon {
        left: 12px;
    }
    
    .auth-btn {
        padding: 12px;
        font-size: 16px; /* Previene zoom su iOS */
    }
}

@media (max-width: 360px) {
    .auth-header {
        padding: 20px 10px 10px;
    }
    
    .auth-body {
        padding: 15px 10px;
    }
}

/* Dark Mode Support (per future implementazioni) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #2d2d2d;
        --bg-secondary: #3d3d3d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-light: #999999;
        --border-color: #555555;
    }
    
    .auth-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .auth-card {
        animation: none;
    }
}

/* Focus per navigazione keyboard */
.form-input:focus,
.auth-btn:focus,
.auth-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .auth-btn {
        border: 2px solid var(--primary-color);
    }
}