/* welcome.css - Stile Premium per il nuovo refactoring */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #0f172a;
    /* Slate 900 base */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.5) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.5) 0, transparent 50%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Base Glassmorphism Container */
.glass-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-wrapper {
    margin-bottom: 1.5rem;
}

.brand-logo {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0px 4px 10px rgba(255, 255, 255, 0.1));
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.05rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    font-weight: 300;
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    position: relative;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    outline: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: #94a3b8;
    font-weight: 400;
    padding: 10px;
}

.btn-ghost:hover {
    color: #f8fafc;
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #475569;
    margin: 10px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #334155;
}

.divider span {
    padding: 0 10px;
    font-size: 0.85rem;
}

/* Blocca lo scroll della pagina dietro quando una modale è aperta */
body.modal-open {
    overflow: hidden;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Permette scrolling corretto se il contenuto è più alto dello schermo */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    /* Rende l'overlay stesso scrollabile quando il form è troppo alto */
    overflow-y: auto;
    padding: 20px;
}

/* Isoliamo la sfocatura in un livello fisso per prevenire bug rendering su mobile quando scrolli */
.modal-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.glass-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    margin: 40px auto; /* 40px di respiro sopra e sotto, auto di lato */
}

.modal-overlay.active .glass-card {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.glass-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #f8fafc;
}

.modal-desc {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.input-group input:not([type="checkbox"]) {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #f8fafc;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Wrapper della password relativo e icona assoluta */
.password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px !important;
}

.password-toggle { 
    position: absolute; right: 15px; 
    cursor: pointer; color: #94a3b8;
    opacity: 0.6; transition: opacity 0.2s;
    display: flex; align-items: center;
}
.password-toggle:hover { opacity: 1; }

/* Rende bianca (invertendo il nero predefinito) l'icona dell'orologio/calendario sui browser moderni */
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    display: inline;
    margin-bottom: 0;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.9rem;
}

.w-100 {
    width: 100%;
    margin-top: 10px;
}

.d-none {
    display: none !important;
}

.status-msg {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-msg.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- DASHBOARD STYLES --- */
.dashboard-body {
    align-items: flex-start;
    padding-top: 40px;
}

.dashboard-container {
    width: 100%;
    max-width: 800px;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 100%;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.role-badge {
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.clock-display {
    font-size: clamp(1.8rem, 10vw, 4rem);
    font-weight: 800;
    color: #f8fafc;
    margin: 1.5rem auto;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    display: block;
    width: 100%;
}

.dashboard-actions {
    flex-direction: row;
    justify-content: center;
    margin-top: 2rem;
}

.history-card {
    text-align: left;
}

.history-card h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
    font-size: 1.2rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.hist-date {
    color: #f8fafc;
    font-weight: 600;
    font-size: 1.05rem;
}

.hist-time {
    color: #94a3b8;
    font-size: 0.95rem;
    display: flex;
    gap: 15px;
}

.badge-in {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-out {
    color: #f43f5e;
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 600px) {
    .glass-card {
        padding: 1.5rem;
        width: 95%;
    }
    .glass-card h2 {
        font-size: 1.5rem;
    }
    .clock-display {
        letter-spacing: 1px;
    }
    .dashboard-actions { flex-direction: column; }
    .history-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .dash-header { flex-direction: column; gap: 15px; }
}