/* Reset e configurações base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais - Tons de Azul Medicina */
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #0369a1;
    --accent-light: #0284c7;
    
    /* Cores neutras */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Cores de estado */
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    
    /* Sombras */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Bordas */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transições */
    --transition-fast: all 0.15s ease-out;
    --transition: all 0.2s ease-out;
    --transition-slow: all 0.3s ease-out;
}

/* Configurações gerais */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Container principal */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* ============================================
   SEÇÃO DE BRANDING - Design Moderno v2
   ============================================ */
.brand-section {
    background: linear-gradient(160deg, #070b1a 0%, #0c1535 30%, #111d45 60%, #0f1b3d 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

/* Aurora gradient overlay animado */
.brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(56, 189, 248, 0.06) 0%, transparent 40%);
    animation: auroraShift 20s ease-in-out infinite alternate;
    z-index: 1;
}

/* Subtle dot grid */
.brand-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 1;
}

@keyframes auroraShift {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-3%, 2%) scale(1.02); }
    50% { transform: translate(2%, -3%) scale(0.98); }
    75% { transform: translate(-2%, 4%) scale(1.01); }
    100% { transform: translate(3%, -2%) scale(1); }
}

/* ===== Floating glass orbs ===== */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 2;
    pointer-events: none;
}

.orb-1 {
    width: 320px;
    height: 320px;
    top: -12%;
    right: -18%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
}

.orb-2 {
    width: 220px;
    height: 220px;
    bottom: 8%;
    left: -12%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
}

.orb-3 {
    width: 160px;
    height: 160px;
    top: 55%;
    right: 15%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 70%);
}

/* ===== ECG Monitor line contínuo ===== */
.ecg-monitor {
    position: absolute;
    width: 200%;
    height: 80px;
    bottom: 22%;
    left: 0;
    z-index: 2;
    pointer-events: none;
    animation: ecgScroll 10s linear infinite;
}

.ecg-line {
    fill: none;
    stroke: rgba(96, 165, 250, 0.9);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}

@keyframes ecgScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== Brand content area ===== */
.brand-content {
    text-align: center;
    max-width: 440px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero logo */
.brand-logo-area {
    margin-bottom: 1.5rem;
}

.brand-hero-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 22px;
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.brand-hero-logo:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 
        0 12px 40px rgba(59, 130, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Hero title */
.brand-hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    line-height: 1;
    margin: 0 0 0.5rem 0;
    font-family: 'Montserrat', 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 40%, #60a5fa 70%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(96, 165, 250, 0.3));
}

.brand-hero-subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-style: italic;
    font-family: 'Raleway', 'Inter', sans-serif;
    color: rgba(147, 197, 253, 0.9);
    margin: 0 0 2rem 0;
}

/* Divider animado */
.brand-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.8), transparent);
    border-radius: 2px;
    margin: 0 auto 2rem;
    position: relative;
}

.brand-divider::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 1), transparent);
    border-radius: 2px;
    animation: dividerPulse 3s ease-in-out infinite;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.4; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.3); }
}

/* Welcome text - hero style */
.brand-welcome-hero {
    margin: 0 0 1.2rem 0;
    text-align: center;
    line-height: 1.1;
}

.brand-welcome-hero .welcome-line {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Montserrat', 'Inter', sans-serif;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 40%, #60a5fa 70%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(96, 165, 250, 0.3));
}

.brand-welcome-hero .welcome-line-sub {
    display: block;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-style: italic;
    font-family: 'Raleway', 'Inter', sans-serif;
    color: rgba(147, 197, 253, 0.9);
    margin-top: 0.4rem;
}

.brand-tagline-hero {
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(203, 213, 225, 0.6);
    margin: 0 0 2.5rem 0;
    letter-spacing: 0.04em;
    text-align: center;
}

/* ===== Feature pills ===== */
.feature-pills {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(203, 213, 225, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-pill svg {
    width: 16px;
    height: 16px;
    color: rgba(147, 197, 253, 0.7);
    flex-shrink: 0;
}

.feature-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.feature-pill:hover svg {
    color: rgba(147, 197, 253, 1);
}

/* ===== Entry animations (fallback, Anime.js overrides) ===== */
.anim-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: brandFadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes brandFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Seção do Formulário - Glass Card */
.form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8edf8 40%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

/* Sutil glass texture na seção */
.form-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(30, 64, 175, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px rgba(30, 64, 175, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
    transition: box-shadow 0.4s ease;
}

.form-wrapper:hover {
    box-shadow: 
        0 12px 48px rgba(30, 64, 175, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.06);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Container com logo e texto lado a lado */
.logo-brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header-logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.brand-text-header {
    text-align: left;
}

.brand-text-header .brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    font-family: 'Montserrat', 'Inter', sans-serif;
    margin: 0;
}

.brand-text-header .brand-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-style: italic;
    font-family: 'Raleway', 'Inter', sans-serif;
    color: #60a5fa;
    margin: 0;
    margin-top: 0.25rem;
}

.brand-greeting {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 1rem 0;
    letter-spacing: 0.05em;
    font-family: 'Montserrat', 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 30%, #bae6fd 60%, #7dd3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Mensagem festiva no login */
.festive-greeting-login {
    display: none;
    margin-top: 1.5rem;
    text-align: center;
}

.festive-greeting-login .festive-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: festive-pulse 2s ease-in-out 3;
}

.festive-greeting-login .festive-icon {
    font-size: 2.5rem;
    animation: festive-bounce 1s ease-in-out 3;
}

.festive-greeting-login .festive-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.festive-greeting-login .festive-subtext {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    font-family: 'Raleway', 'Inter', sans-serif;
}

@keyframes festive-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

@keyframes festive-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.brand-tagline {
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(219, 234, 254, 0.95);
    text-align: center;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-style: italic;
    font-family: 'Raleway', 'Inter', sans-serif;
    letter-spacing: 0.03em;
}

.form-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.form-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.form-subtitle {
    min-height: 1.5em;
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* 🎬 Stagger animation - campos aparecem com delay */
.login-form > * {
    animation: staggerIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.login-form > *:nth-child(1) { animation-delay: 0.15s; }
.login-form > *:nth-child(2) { animation-delay: 0.25s; }
.login-form > *:nth-child(3) { animation-delay: 0.35s; }
.login-form > *:nth-child(4) { animation-delay: 0.45s; }
.login-form > *:nth-child(5) { animation-delay: 0.55s; }
.login-form > *:nth-child(6) { animation-delay: 0.65s; }
.login-form > *:nth-child(7) { animation-delay: 0.75s; }

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger para header também */
.form-header {
    animation: staggerIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s both;
}

.form-footer {
    animation: staggerIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.85s both;
}

/* Estados de validação para inputs */
.input-group.valid .input-container input {
    border-color: var(--success);
    background: rgba(5, 150, 105, 0.02);
}

.input-group.valid .input-icon {
    color: var(--success);
}

.input-group.error .input-container input {
    border-color: var(--error);
    background: rgba(220, 38, 38, 0.02);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-group.error .input-icon {
    color: var(--error);
}

.input-group.error label {
    color: var(--error);
    background: var(--error);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group:last-of-type {
    margin-bottom: 1rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    padding: 0.5rem 0.75rem 0.5rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

/* Decorative elements for labels */
.input-group label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(-50%) scaleY(0);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.input-group label::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
    border-radius: 1px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(30, 64, 175, 0.4);
}

/* Hover effects for labels */
.input-group label:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
    text-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
}

.input-group label:hover::before {
    opacity: 0.7;
    transform: translateY(-50%) scaleY(1);
}

.input-group label:hover::after {
    width: 100%;
}

/* Focus states */
.input-group:focus-within label::after {
    width: 100%;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.5);
}

.input-group:focus-within label::before {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
}

.input-group:focus-within label {
    transform: translateY(-2px);
    filter: brightness(1.2);
    text-shadow: 0 3px 12px rgba(30, 64, 175, 0.3);
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-lg);
    isolation: isolate;
}

/* ✨ Animated gradient border overlay */
.input-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(270deg, var(--primary), var(--primary-light), #06b6d4, var(--accent), var(--primary));
    background-size: 300% 300%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.input-container:focus-within::before {
    opacity: 1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.input-icon {
    position: absolute;
    left: 1.125rem;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    z-index: 2;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* 🎯 Icon bounce animation on focus */
.input-container:focus-within .input-icon {
    color: var(--primary);
    animation: iconBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconBounce {
    0%   { transform: scale(1) rotate(0deg); }
    25%  { transform: scale(1.3) rotate(-10deg); }
    50%  { transform: scale(0.9) rotate(5deg); }
    75%  { transform: scale(1.12) rotate(-2deg); }
    100% { transform: scale(1.05) rotate(0deg); }
}

/* Input */
.input-container input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
}

/* Enhanced focus */
.input-container input:focus {
    border-color: transparent;
    box-shadow:
        0 0 0 1px rgba(30, 64, 175, 0.15),
        0 4px 16px rgba(30, 64, 175, 0.1);
    transform: translateY(-1px);
    background: #fff;
}

.input-container input:hover:not(:focus) {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-container input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
    transition: all 0.3s ease;
}

.input-container input:focus::placeholder {
    color: var(--gray-300);
    transform: translateX(4px);
}

/* 👁️ Toggle de senha animado */
.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(30, 64, 175, 0.08);
    transform: scale(1.1);
}

.password-toggle:active {
    transform: scale(0.9);
}

.password-toggle .eye-icon {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    transition: all 0.25s ease;
}

.password-toggle:hover .eye-icon {
    color: var(--primary);
}

.password-toggle .eye-icon.hiding {
    animation: eyeFlip 0.3s ease;
}

@keyframes eyeFlip {
    0%   { transform: scaleY(1); opacity: 1; }
    50%  { transform: scaleY(0); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}

/* Opções do formulário */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.5rem 0;
}

/* ✅ Checkbox customizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--gray-800);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    background: white;
}

.custom-checkbox svg {
    width: 12px;
    height: 10px;
    stroke: white;
    stroke-width: 2.5;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.checkbox-label input[type="checkbox"]:checked ~ .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.checkbox-label input[type="checkbox"]:checked ~ .custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label input[type="checkbox"]:focus-visible ~ .custom-checkbox {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.checkbox-label:hover .custom-checkbox {
    border-color: var(--primary-light);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-out, text-decoration-color 0.2s ease-out;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Mensagem de erro */
.error-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgb(239 68 68 / 0.1);
    border: 1px solid rgb(239 68 68 / 0.2);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
    animation: shakeError 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.error-container svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ⚡ Indicador de Caps Lock */
.caps-lock-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgb(245 158 11 / 0.08);
    border: 1px solid rgb(245 158 11 / 0.2);
    border-radius: var(--radius-md);
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    animation: slideDown 0.25s ease-out;
}

.caps-lock-indicator i {
    font-size: 0.9rem;
}

/* ⚡ Floating Labels */
.input-group.floating {
    gap: 0;
}

.input-group.floating .input-container input {
    padding-top: 1.4rem;
    padding-bottom: 0.6rem;
}

/* Override all the heavy .input-group label styles for floating labels */
.input-group.floating .floating-label {
    position: absolute;
    left: 3.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-400);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    /* Reset inherited .input-group label styles */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: currentColor;
    background-clip: unset;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    padding: 0;
    margin: 0;
    display: block;
    width: auto;
    filter: none;
    cursor: default;
    user-select: none;
}

/* Remove decorative pseudo-elements on floating labels */
.input-group.floating .floating-label::before,
.input-group.floating .floating-label::after {
    display: none !important;
    content: none !important;
}

.input-group.floating .input-container input:focus ~ .floating-label,
.input-group.floating .input-container input:not(:placeholder-shown) ~ .floating-label {
    top: 0.45rem;
    transform: translateY(0);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    -webkit-text-fill-color: var(--primary);
}

/* ⚡ Timeout visual no botão */
.login-btn .btn-timeout-text {
    display: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

.login-btn.loading .btn-timeout-text {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mensagem de ajuda */
.help-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, rgb(59 130 246 / 0.08) 0%, rgb(30 64 175 / 0.12) 100%);
    border: 1px solid rgb(59 130 246 / 0.2);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 0.8125rem;
    position: relative;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgb(59 130 246 / 0.12);
}

.help-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
}

.help-icon svg {
    width: 100%;
    height: 100%;
    color: var(--primary);
}

.help-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.help-message {
    color: var(--gray-700);
    margin: 0;
    line-height: 1.4;
    font-size: 0.8125rem;
}

.help-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.125rem 0;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgb(255 255 255 / 0.8);
    border: 1px solid rgb(59 130 246 / 0.15);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--primary);
    font-size: 0.75rem;
    transition: var(--transition);
}

.contact-item:hover {
    background: rgb(59 130 246 / 0.1);
    border-color: rgb(59 130 246 / 0.3);
    transform: translateY(-1px);
}

.help-note {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-style: italic;
    margin: 0;
    padding-top: 0.25rem;
    border-top: 1px solid rgb(59 130 246 / 0.15);
}

.help-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.help-close:hover {
    background: rgb(59 130 246 / 0.1);
    color: var(--primary);
    transform: scale(1.1);
}

.help-close svg {
    width: 12px;
    height: 12px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade para mensagem de ajuda */
@media (max-width: 480px) {
    .help-container {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .help-contacts {
        gap: 0.375rem;
    }
    
    .contact-item {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .help-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 28px;
        height: 28px;
    }
}

/* Modal de Ajuda */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.help-modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.help-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    position: relative;
}

.help-modal-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.help-modal-icon svg {
    width: 100%;
    height: 100%;
}

.help-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.help-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.help-modal-close svg {
    width: 16px;
    height: 16px;
}

.help-modal-body {
    padding: 1.5rem;
}

.help-modal-body p {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
    line-height: 1.5;
}

.help-modal-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.help-modal-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
}

.help-modal-contact:hover {
    background: rgb(59 130 246 / 0.05);
    border-color: rgb(59 130 246 / 0.2);
    transform: translateY(-1px);
}

.contact-icon {
    font-size: 1.25rem;
}

.contact-text {
    font-weight: 500;
    color: var(--gray-900);
}

.help-modal-info {
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.help-modal-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-style: italic;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .help-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .help-modal-header {
        padding: 1.25rem;
    }
    
    .help-modal-body {
        padding: 1.25rem;
    }
    
    .help-modal-contact {
        padding: 0.75rem;
    }
}

/* Botão de login com shimmer */
.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 50%, var(--primary-light) 100%);
    background-color: var(--primary);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-position 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
    overflow: hidden;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.25);
    opacity: 1;
    visibility: visible;
}

/* 💓 Hover suave no botão */
.login-btn:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 8px 25px rgba(30, 64, 175, 0.35),
        0 0 20px rgba(59, 130, 246, 0.15);
}

.login-btn:focus {
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2), 0 4px 15px rgba(30, 64, 175, 0.25);
}

.login-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.btn-text {
    position: relative;
    z-index: 2;
    color: white;
}

/* ⏳ Loading - Progress bar com shimmer */
.btn-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
}

.loader-progress-track {
    width: 60%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    border-radius: 2px;
    animation: progressSlide 1.5s ease-in-out infinite;
}

@keyframes progressSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.loader-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
}

.btn-arrow {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(2px);
}

/* ⌨️ Efeito de texto digitando */
.typing-subtitle {
    display: inline;
    border-right: 2px solid var(--primary-light);
    animation: blinkCursor 0.75s step-end infinite;
    padding-right: 2px;
}

.typing-subtitle.done {
    border-right-color: transparent;
    animation: none;
}

@keyframes blinkCursor {
    0%, 100% { border-right-color: var(--primary-light); }
    50% { border-right-color: transparent; }
}

/* 🛡️ Footer SSL com pulso */
.form-footer {
    margin-top: 2rem;
    text-align: center;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.security-info svg {
    width: 14px;
    height: 14px;
    color: var(--success);
}

.ssl-pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: sslPulse 2s ease-in-out 3;
    flex-shrink: 0;
}

@keyframes sslPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50%      { opacity: 0.6; box-shadow: 0 0 0 4px rgba(5, 150, 105, 0); }
}

/* Background decorativo */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="%23f1f5f9" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.5;
}

.bg-gradient {
    position: absolute;
    top: -50%;
    right: -25%;
    width: 50%;
    height: 200%;
    background: linear-gradient(135deg, transparent 0%, rgb(37 99 235 / 0.05) 50%, transparent 100%);
    transform: rotate(15deg);
}

/* ===== Footer Moderno Glass ===== */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(8, 12, 30, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.6rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.login-footer p {
    margin: 0;
    font-size: 0.7rem;
    color: rgba(203, 213, 225, 0.5);
    letter-spacing: 0.02em;
}

.developer-credit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: rgba(147, 197, 253, 0.6);
}

.wm-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.developer-credit:hover .wm-logo {
    opacity: 1;
}

.developer-credit strong {
    color: rgba(96, 165, 250, 0.8);
    font-weight: 600;
}

.developer-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.developer-link strong {
    color: rgba(96, 165, 250, 0.8);
    font-weight: 600;
    transition: all 0.2s ease;
}

.developer-link:hover strong {
    color: #93c5fd;
    text-shadow: 0 0 8px rgba(147, 197, 253, 0.3);
}

/* Responsividade */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .brand-section {
        padding: 1.5rem 2rem;
        min-height: auto;
    }
    
    .brand-content {
        max-width: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 2rem;
    }
    
    .brand-logo-area {
        margin-bottom: 0;
    }
    
    .brand-hero-logo {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }
    
    .brand-hero-title {
        font-size: 2.5rem;
    }
    
    .brand-hero-subtitle {
        margin-bottom: 0.5rem;
    }
    
    .brand-divider {
        display: none;
    }
    
    .brand-welcome,
    .brand-description-text {
        display: none;
    }
    
    .feature-pills {
        gap: 0.4rem;
    }
    
    .feature-pill {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }
    
    .ecg-monitor {
        height: 50px;
        bottom: 10%;
        opacity: 0.08;
    }
    
    .floating-orb {
        display: none;
    }
    
    .benefit-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    /* Ocultar seção de branding no mobile */
    .brand-section {
        display: none;
    }
    
    /* Mostrar logo mobile */
    .mobile-logo {
        display: flex;
    }
    
    .form-section {
        padding: 1rem;
        background: linear-gradient(135deg, var(--gray-50) 0%, white 50%, var(--gray-50) 100%);
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .benefits {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .benefit-item {
        flex-direction: row;
        text-align: left;
        padding: 1rem;
        min-height: auto;
    }
    
    .benefit-text {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 0.75rem;
        padding-bottom: 100px; /* Espaço para o footer fixo */
    }
    
    .mobile-logo-img {
        width: 35px;
        height: 35px;
    }
    
    .mobile-logo h3 {
        font-size: 1rem;
    }
    
    .form-wrapper {
        max-width: none;
    }
    
    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    /* Footer menor em telas pequenas */
    .login-footer {
        padding: 0.4rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .login-footer p,
    .developer-credit {
        font-size: 0.65rem;
    }
}

/* Estados de carregamento (controlado via JS inline styles) */

/* Telas muito pequenas (iPhone SE, etc) */
@media (max-height: 700px) {
    .form-section {
        padding-bottom: 90px;
        overflow-y: auto;
    }
    
    .form-wrapper {
        padding: 1rem;
    }
    
    .form-header {
        margin-bottom: 0.75rem;
    }
    
    .form-header h2 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .form-header p {
        font-size: 0.8rem;
    }
    
    .login-form {
        gap: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .input-wrapper input {
        padding: 0.6rem 0.75rem 0.6rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .btn-login {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .form-options {
        margin-top: 0.5rem;
    }
    
    .mobile-logo {
        margin-bottom: 0.5rem;
    }
    
    .mobile-logo-img {
        width: 30px;
        height: 30px;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visível para navegação por teclado */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Estilo para modo escuro (futuro) */
@media (prefers-color-scheme: dark) {
    /* Implementação futura do tema escuro */
}