:root {
    --primary: #2193b0;
    --primary-dark: #2193b0;
    --primary-light: #6dd5ed;
    --gradient: linear-gradient(45deg, #2193b0, #6dd5ed);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.left-side {
    position: relative;
    width: 40%;
    overflow: hidden;
    background: var(--gradient);
}

.left-side::before,
.left-side::after {
    content: "";
    position: absolute;
    left: 0;
    width: 200%;
    height: 200%;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 38%;
    transform-origin: 50% 49%;
}

.left-side::before { animation: drift 12s infinite linear; }
.left-side::after  { animation: drift 15s infinite linear; opacity: 0.5; }

@keyframes drift {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.wave1, .wave2, .wave3 {
    position: absolute;
    width: 200%;
    height: 200%;
    bottom: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 38%;
}

.wave1 { animation: drift 20s infinite linear; opacity: 0.3; }
.wave2 { animation: drift 25s infinite linear reverse; opacity: 0.2; }
.wave3 { animation: drift 30s infinite linear; opacity: 0.1; }

.left-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 40px;
}

.logo-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 48px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.logo-icon img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 10px; }
.logo-icon i   { font-size: 48px; }

.left-content h1 {
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.left-content p { opacity: 0.9; font-weight: 400; font-size: 16px; max-width: 400px; }

.right-side {
    position: relative;
    width: 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--gray-50);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 6px;
    height: 100%;
    background: var(--gradient);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.login-header { margin-bottom: 30px; text-align: center; }
.login-header h2 { margin: 0; color: var(--gray-900); font-size: 24px; font-weight: 600; }
.login-header p  { margin-top: 8px; color: var(--gray-600); font-size: 14px; }

.form-group { position: relative; margin-bottom: 25px; width: 100%; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.input-wrapper { position: relative; }

.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 147, 176, 0.15);
    background: white;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
    z-index: 2;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px;
    z-index: 2;
}

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

.checkbox-wrapper { display: flex; align-items: center; margin-bottom: 25px; }

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.checkbox.checked { background: var(--primary); border-color: var(--primary); }

.checkbox.checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label { font-size: 14px; color: var(--gray-700); cursor: pointer; }

.btn-login {
    width: 100%;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(33, 147, 176, 0.3);
}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(33, 147, 176, 0.4); }
.btn-login:active { transform: translateY(0); }

.btn-login::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .3s, opacity .5s;
}

.btn-login:active::after { transform: scale(0, 0); opacity: .3; transition: 0s; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error   { background: #fef2f2; color: #dc2626; border-left: 4px solid #dc2626; }
.alert-success { background: #f0fdf4; color: #16a34a; border-left: 4px solid #16a34a; }

.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.footer-text { color: var(--gray-600); font-size: 12px; }

.franquia-badge {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 20;
}

.btn-loading { position: relative; color: transparent; }

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    top: 50%; left: 50%;
    margin-left: -8px; margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.language-selector-wrapper {
    position: absolute;
    top: 20px; right: 20px;
    z-index: 1000;
}

.btn-language {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--gray-700);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-language:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-text { font-weight: 500; }

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 160px;
}

.dropdown-item {
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-item:hover { background: var(--gray-100); color: var(--primary); }
.dropdown-item.active { background: rgba(33, 147, 176, 0.1); color: var(--primary); font-weight: 500; }

.flag-icon { margin-right: 8px; font-size: 16px; }

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .language-selector-wrapper { top: 10px; right: 10px; }
    .btn-language { padding: 6px 10px; font-size: 13px; }
    .language-text { display: none; }
    .btn-language .bi-translate { margin-right: 0; font-size: 16px; }
    .login-container { flex-direction: column; }
    .left-side  { width: 100%; height: 25vh; }
    .right-side { width: 100%; height: 75vh; padding: 20px; justify-content: flex-start; overflow-y: auto; }
    .login-card { padding: 30px 25px; max-width: 100%; margin: 0 auto; width: 95%; }
    .left-content { padding: 20px; }
    .logo-icon { width: 80px; height: 80px; font-size: 32px; margin-bottom: 15px; }
    .left-content h1 { font-size: 22px; }
    .left-content p  { font-size: 14px; }
    .franquia-badge { top: 10px; right: 10px; font-size: 10px; padding: 6px 12px; }
}

@media (max-width: 480px) {
    .login-card { padding: 25px 20px; }
    .right-side { padding: 15px; }
    .form-control { padding: 12px 16px 12px 44px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .login-container { flex-direction: row; }
    .left-side  { width: 30%; height: 100vh; }
    .right-side { width: 70%; height: 100vh; justify-content: center; }
}
