/* =========================================
   GastroGestiónNexus - Login Page
   ========================================= */

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fed7aa;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.75);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.1);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(249, 115, 22, 0.5);
    --error-color: #ef4444;
    --success-color: #22c55e;
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

/* Background Effects */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    background: radial-gradient(circle at 50% 50%, #111118 0%, #050508 100%);
}

.beams-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.beam {
    position: absolute;
    width: 2px;
    height: 150%;
    background: linear-gradient(to bottom, transparent, var(--primary), transparent);
    opacity: 0.4;
    filter: blur(2px);
    transform: rotate(35deg);
    animation: beamMove 12s infinite linear;
}

@keyframes beamMove {
    from { transform: rotate(35deg) translateY(-100%); }
    to { transform: rotate(35deg) translateY(100%); }
}

.beam-1 { left: 15%; animation-duration: 15s; width: 3px; }
.beam-2 { left: 45%; animation-duration: 12s; opacity: 0.3; width: 6px; filter: blur(4px); }
.beam-3 { left: 75%; animation-duration: 18s; animation-delay: -5s; width: 2px; }
.beam-4 { left: 95%; animation-duration: 10s; animation-delay: -2s; opacity: 0.25; width: 3px; }

.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 60% 40% at 50% -10%, rgba(249, 115, 22, 0.15) 0%, transparent 80%),
        radial-gradient(ellipse 40% 40% at 90% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    z-index: 1;
}

.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 25s infinite ease-in-out;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.2), transparent 70%);
    top: -100px; left: -100px;
}

.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
    bottom: -50px; right: -50px;
}

.orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12), transparent 70%);
    top: 40%; left: 50%;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -60px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.9); }
}

/* Login Card */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 380px;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
}

@keyframes cardIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon {
    display: inline-flex;
    margin-bottom: 8px;
    animation: logoIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: scale(0.8);
}

@keyframes logoIn {
    to { opacity: 1; transform: scale(1); }
}

.logo-icon svg {
    filter: drop-shadow(0 8px 16px rgba(249, 115, 22, 0.4));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-card:hover .logo-icon svg {
    transform: scale(1.08) rotate(5deg);
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-title span {
    background: linear-gradient(135deg, var(--primary), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.15), 
                inset 0 0 10px rgba(249, 115, 22, 0.05);
}

.input-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.input-wrapper input {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: var(--transition);
}

.toggle-password:hover { color: var(--text-secondary); }

.error-text {
    display: block;
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 6px;
    min-height: 18px;
}

.form-group.has-error .input-wrapper {
    border-color: var(--error-color);
}

/* Button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -8px rgba(249, 115, 22, 0.5);
    filter: brightness(1.1);
}

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

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

.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error Message */
.error-message {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.85rem;
    text-align: center;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 36px 24px;
    }
}
