:root {
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1e293b;
    --text-muted: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #e0f2fe, #bae6fd, #f8fafc, #e2e8f0);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    padding: 20px;
    color: var(--text-main);
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.blob {
    position: absolute; filter: blur(60px); z-index: 0; opacity: 0.6;
    border-radius: 50%; animation: float 10s infinite ease-in-out alternate;
}
.blob-1 { top: 10%; left: 15%; width: 300px; height: 300px; background: #38bdf8; animation-delay: 0s; }
.blob-2 { bottom: 10%; right: 15%; width: 350px; height: 350px; background: #818cf8; animation-delay: -5s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -50px) scale(1.1); }
}

.login-glass-card {
    position: relative; z-index: 10;
    width: 100%; max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(20px); opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.logo-container { text-align: center; margin-bottom: 25px; }
.logo-icon {
    width: 70px; height: 70px; background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 20px; margin: 0 auto 15px auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: white; box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
    transform: rotate(-5deg); transition: 0.3s;
}
.login-glass-card:hover .logo-icon { transform: rotate(0deg) scale(1.05); }

h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 5px; color: var(--text-main); }
p.subtitle { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; margin-bottom: 25px; }

.ios-segment {
    display: flex; background: rgba(0, 0, 0, 0.05); padding: 4px;
    border-radius: 14px; margin-bottom: 30px; position: relative;
}
.ios-segment input[type="radio"] { display: none; }
.ios-segment label {
    flex: 1; text-align: center; padding: 10px; font-size: 0.9rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer; z-index: 2; transition: color 0.3s;
}
.ios-segment .glider {
    position: absolute; top: 4px; left: 4px; height: calc(100% - 8px); width: calc(50% - 4px);
    background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1;
}
#tab-empleado:checked ~ .glider { transform: translateX(100%); }
#tab-admin:checked ~ label[for="tab-admin"] { color: var(--primary); }
#tab-empleado:checked ~ label[for="tab-empleado"] { color: var(--primary); }

.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; margin-left: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.apple-input {
    width: 100%; padding: 16px; background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 16px;
    font-size: 1rem; color: var(--text-main); outline: none;
    transition: all 0.3s; box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}
.apple-input:focus {
    background: white; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), inset 0 2px 5px rgba(0,0,0,0.01);
}

.btn-submit {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 16px; border-radius: 16px; font-size: 1.05rem; font-weight: 700;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 10px;
}
.btn-submit:hover { transform: translateY(-3px); background: var(--primary-hover); box-shadow: 0 12px 25px rgba(14, 165, 233, 0.4); }
.btn-submit:active { transform: translateY(1px); }

.spinner {
    display: none; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.error-toast {
    background: #fef2f2; border: 1px solid #fca5a5; color: #ef4444;
    padding: 12px; border-radius: 12px; font-size: 0.9rem; font-weight: 600;
    margin-bottom: 20px; display: none; text-align: center;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}