@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-dark: #1a1d29;
    --primary-light: #f8fafc;
    --secondary: #4f46e5;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Sfondo con effetti fluttuanti */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    z-index: 1;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.floating-shape {
    position: absolute;
    background: rgba(79, 70, 229, 0.03);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 300px;
    height: 300px;
    top: 50%;
    right: 10%;
    animation-delay: -2s;
}

.floating-shape:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: -4s;
}

.floating-shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: -6s;
    background: rgba(6, 182, 212, 0.03);
}

.floating-shape:nth-child(5) {
    width: 250px;
    height: 250px;
    bottom: 10%;
    right: 5%;
    animation-delay: -1s;
    background: rgba(16, 185, 129, 0.02);
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-20px) translateX(10px) rotate(90deg); 
    }
    50% { 
        transform: translateY(-10px) translateX(-10px) rotate(180deg); 
    }
    75% { 
        transform: translateY(-30px) translateX(5px) rotate(270deg); 
    }
}

/* Container principale */
.login-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Card di login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

/* Header della card */
.login-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-light);
    padding: 40px 32px;
    text-align: center;
    position: relative;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
}

.logo-container {
    margin-bottom: 24px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-md);
}

.logo-icon i {
    font-size: 28px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Body della card */
.login-body {
    padding: 32px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-label i {
    margin-right: 8px;
    color: var(--text-secondary);
    width: 16px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Button */
.btn-login {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--secondary) 0%, #4338ca 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

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

/* Demo credentials */
.demo-section {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}

.demo-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-title i {
    color: var(--info);
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.demo-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.demo-role {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.demo-email {
    font-size: 11px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    margin-bottom: 4px;
}

.demo-password {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 20px 5%;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .login-card {
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    .login-header {
        padding: 32px 20px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .login-subtitle {
        font-size: 13px;
    }
    
    .login-body {
        padding: 24px 20px;
    }
    
    .floating-shapes {
        display: none;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .demo-item {
        padding: 10px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .btn-login {
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px 5%;
        padding-top: 30px;
    }
    
    .login-header {
        padding: 24px 16px;
    }
    
    .login-body {
        padding: 20px 16px;
    }
    
    .login-title {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .logo-icon i {
        font-size: 24px;
    }
    
    .demo-section {
        padding: 16px;
    }
    
    .demo-item {
        padding: 8px;
    }
    
    .demo-email, .demo-password {
        font-size: 10px;
    }
}

@media (max-height: 700px) {
    .login-container {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .login-header {
        padding: 24px 32px;
    }
    
    .login-body {
        padding: 24px 32px;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }
    
    .logo-icon i {
        font-size: 24px;
    }
    
    .demo-section {
        margin-top: 16px;
        padding: 16px;
    }
}