:root {
    --primary: #004a99;
    --primary-light: #0066cc;
    --secondary: #6c757d;
    --accent: #ff6600;
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    --success: #2bc155;
    --error: #e74c3c;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

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

body {
    background: #0d2137;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fondo inicio (/web): imagen centrada y cubriendo bien el viewport */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-color: #0a1628;
    background-image: url('img/trabajadores.jpg.jpeg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    /* En móviles algunos navegadores ignoran fixed; cover + center sigue aplicando */
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body::before {
        background-attachment: scroll;
    }
}

/* Velado suave para que el formulario se lea bien sobre la foto */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        155deg,
        rgba(0, 55, 115, 0.38) 0%,
        rgba(0, 25, 55, 0.55) 100%
    );
}

/* Auth Pages Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

input.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 74, 153, 0.1);
    outline: none;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 74, 153, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 74, 153, 0.3);
}

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-tab {
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    transition: color 0.3s;
}

.nav-tab.active {
    color: var(--primary);
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-tab.active::after {
    width: 100%;
}

/* View Management */
.view {
    display: none;
}

.view.active {
    display: block !important;
    animation: fadeIn 0.4s ease-out;
}

/* Password Requirements */
.req-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.req-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.req-item.met {
    color: var(--success);
    font-weight: 600;
}

.req-item ion-icon {
    font-size: 1rem;
}

/* Animations */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* Botón Panel Admin - esquina superior derecha */
.admin-corner-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 100;
    transition: background 0.2s, transform 0.2s;
}
.admin-corner-btn:hover {
    background: var(--primary-light);
    color: #fff;
    transform: translateY(-1px);
}
.admin-corner-btn ion-icon {
    font-size: 1.2rem;
}

/* Inicio (/web index): mejor uso en móvil */
@media (max-width: 600px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    .auth-container {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 1.25rem;
        min-height: 100dvh;
        min-height: 100vh;
    }

    .auth-card {
        padding: 1.35rem 1.1rem;
        border-radius: 18px;
    }

    h1 {
        font-size: 1.65rem;
    }

    .req-grid {
        grid-template-columns: 1fr;
    }

    .admin-corner-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.82rem;
        gap: 0.35rem;
    }
}

@media (max-width: 400px) {
    .admin-corner-btn span {
        display: none;
    }
}