/* ============= MODERN DASHBOARD STYLES ============= */

/* Font Import */
@font-face {
    font-family: 'Lufga';
    src: url('font/Lufga-Regular.eot');
    src: local('Lufga Regular'), local('Lufga-Regular'),
        url('font/Lufga-Regular.eot?#iefix') format('embedded-opentype'),
        url('font/Lufga-Regular.woff2') format('woff2'),
        url('font/Lufga-Regular.woff') format('woff'),
        url('font/Lufga-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* CSS Variables */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lufga', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    background-color: var(--bg-light);
    color: var(--text-primary);
}

body {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ============= LAYOUT ============= */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-light);
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0 20px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, background 0.2s;
    margin-right: 12px;
}

.hamburger:hover, 
.hamburger:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    outline: none;
}

.hamburger i {
    color: #fff;
    transition: color 0.2s;
}

.hamburger:active i {
    color: #e0e7ff;
}

/* ============= HEADER ============= */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: #fff;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .brand h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.site-header .top-nav {
    display: flex;
    gap: 20px;
}

.site-header .top-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 6px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.site-header .top-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Layout with Sidebar */
.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease-in-out;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}

.sidebar-nav li a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 24px;
}

.sidebar-nav li a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-light);
}

.main-content section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.main-content h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.main-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ============= DASHBOARD CARDS ============= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.card-description {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============= BUTTONS ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-light);
}

/* ============= FOOTER ============= */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 20px 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: auto;
}

/* ============= LOGIN PAGE STYLES ============= */
.login {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
    margin: 50px auto;
    border-radius: 12px;
    overflow: hidden;
}

.login h1 {
    text-align: center;
    color: var(--text-primary);
    font-size: 28px;
    padding: 30px 20px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.login form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 30px 20px;
}

/* Input group for login form to ensure proper alignment */
.login .input-group {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    margin-bottom: 16px;
    height: 50px; /* enforce consistent row height so toggle centers */
}

.login .input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 8px 0 0 8px;
    font-size: 18px;
}

.login form label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 8px 0 0 8px;
    font-size: 18px;
}

.login form input[type="password"],
.login form input[type="text"],
.login form input[type="email"] {
    flex: 1 1 auto;
    height: 100%; /* fill the input-group height */
    border: 1px solid var(--border-color);
    margin: 0;
    padding: 0 15px;
    padding-right: 64px; /* space for the toggle button */
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    transition: var(--transition);
    line-height: 1; /* ensure vertical centering of text */
}

.login form input[type="password"]:focus,
.login form input[type="text"]:focus,
.login form input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Enhanced password toggle button */
.password-group {
    position: relative;
    margin-bottom: 20px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.password-toggle.active,
.password-toggle:active {
    color: var(--primary-color);
}

.password-toggle i {
    transition: transform 0.3s ease, color 0.2s ease;
    font-size: 18px;
}

.password-toggle:hover i {
    transform: scale(1.1);
}

/* Adjust input padding to prevent text overlap with toggle */
.password {
    padding-right: 50px !important;
}

.login form input[type="submit"] {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 0;
    cursor: pointer;
    font-weight: 600;
    color: white;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}

.login form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Page-level login wrapper to harmonize look with dashboard */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 480px;
}

.login-header {
    text-align: center;
    margin-bottom: 18px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    margin: 0 0 6px 0;
    font-weight: 700;
}

.login-header p {
    margin: 0;
    color: rgba(255,255,255,0.92);
}

/* Make the login card sit nicely under the header */
.login {
    margin-top: 6px;
    padding-bottom: 18px;
}

/* Password Toggle */
.password + .unmask {
    position: relative;
    right: 30px;
    top: 25px;
    transform: translateY(-50%);
    text-indent: -9999px;
    width: 25px;
    height: 25px;
    background: #aaa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    appearance: none;
    transition: var(--transition);
}

/* Adjust unmask button for input-group layout */
.input-group .unmask {
    position: relative;
    margin-left: -44px;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Absolute positioning variant for better alignment */
.input-group {
    position: relative;
}

.input-group .unmask {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0; /* ensure internal icon is centered */
}

.input-group .unmask:hover {
    background: rgba(0,0,0,0.06);
}

/* Improved visual styling for password toggle button */
.input-group .unmask {
    border: 0;
    color: var(--text-primary);
    background: transparent;
    transition: background 150ms ease, color 150ms ease, transform 120ms ease;
    box-shadow: none;
    z-index: 3;
}

.input-group .unmask i {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1; /* prevent vertical shift */
}

.input-group .unmask:hover i,
.input-group .unmask:focus i {
    color: var(--primary-dark);
    transform: scale(1.05);
}

/* Visible focus ring for keyboard users */
.input-group .unmask:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
    border-radius: 8px;
}

/* Active (pressed) state */
.input-group .unmask[aria-pressed="true"] {
    background: var(--primary-light);
}

/* Ensure toggle doesn't overlap input text on very small widths */
@media (max-width: 420px) {
    .login form input[type="password"] {
        padding-right: 64px;
    }
    .input-group .unmask {
        right: 8px;
        width: 36px;
        height: 36px;
    }
}

.password + .unmask:hover {
    background: #999;
}

.password + .unmask:before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 17px;
    height: 17px;
    background: #e3e3e3;
    z-index: 1;
    border-radius: 50%;
}

.password[type="text"] + .unmask:after {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 13px;
    height: 13px;
    background: #aaa;
    z-index: 2;
    border-radius: 50%;
}

input#myPass,
label.password {
    transform: translateX(11px);
}

/* ============= TURNSTILE WIDGET ============= */
#turnstile-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    min-height: 78px;
    width: 100%;
}

/* ============= ALERTS & MESSAGES ============= */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ============= RESPONSIVE =============
/* Mobile responsive styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
    }
    
    .site-header {
        padding: 0 15px;
    }
    
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 220px;
        height: 100vh;
        background: #fff;
        box-shadow: 2px 0 8px rgba(0,0,0,0.08);
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
        display: none;
    }
    .sidebar-nav.active {
        transform: translateX(0);
        display: block;
    }
    .main-wrapper {
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
        width: 100%;
    }
    
    .site-header .brand h1 {
        font-size: 18px;
    }
    
    .top-nav {
        display: none;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-nav ul {
        flex-direction: column;
        padding-top: 60px;
    }
    .sidebar-nav li a {
        padding: 16px 24px;
        font-size: 1.1em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .main-content section {
        padding: 20px;
    }
    
    .main-content h2 {
        font-size: 22px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .site-header {
        padding: 0 15px;
        height: 60px;
    }
    
    .site-header .brand h1 {
        font-size: 20px;
    }
    
    .site-header .top-nav {
        gap: 15px;
    }
}

/* Desktop - nasconde hamburger */
@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .login {
        margin: 20px 15px;
    }
    
    .login form label {
        border-radius: 8px 8px 0 0;
        width: 100%;
    }
    
    .login form input[type="password"],
    .login form input[type="text"],
    .login form input[type="email"] {
        width: 100%;
        border-radius: 0 0 8px 8px;
        margin-bottom: 10px;
    }
    
    .site-header .brand h1 {
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px;
    }
}


