/* ============================================
   bitMedico - Login CSS
============================================ */

body.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--gray-100);
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================
   LEFT PANEL - BRANDING
============================================ */
.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left.doctor-theme {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-left.patient-theme {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.login-branding {
    text-align: center;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.login-branding .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.login-branding .logo-icon {
    background: rgba(255,255,255,0.2);
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-branding .logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: white;
}

.login-branding .logo-text span {
    opacity: 0.9;
}

.login-branding h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.login-branding p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 400px;
    line-height: 1.7;
}

.login-features {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.login-feature i {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-feature span {
    font-weight: 500;
}

/* ============================================
   RIGHT PANEL - FORM
============================================ */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-500);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error {
    border-color: var(--danger);
}

/* ============================================
   PASSWORD TOGGLE (OJITO)
============================================ */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 6px;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.password-toggle:focus {
    outline: none;
}

.password-toggle i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* ============================================
   FORM OPTIONS
============================================ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-me input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.remember-me span {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.forgot-link {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ============================================
   LOGIN BUTTON WITH LOADER
============================================ */
.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    transition: all 0.3s ease;
}

.btn-login .btn-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.btn-login .btn-loader {
    display: none;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
}

/* Loading State */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn-login.loading .btn-text {
    opacity: 0;
    visibility: hidden;
}

.btn-login.loading .btn-loader {
    display: flex;
}

/* Spinner Animation */
.spinner {
    width: 20px;
    height: 20px;
    animation: rotate 2s linear infinite;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Button disabled state */
.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   DIVIDER
============================================ */
.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.login-divider span {
    color: var(--gray-400);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ============================================
   MEGACITY BADGE
============================================ */
.megacity-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.megacity-badge i {
    color: var(--primary);
    font-size: 1.25rem;
}

.megacity-badge span {
    font-weight: 600;
    color: var(--dark);
}

.megacity-badge span strong {
    color: var(--primary);
}

/* ============================================
   FOOTER
============================================ */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-switch {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.login-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-weight: 500;
    text-decoration: none;
}

.login-switch a:hover {
    color: var(--primary);
}

/* ============================================
   ALERTS
============================================ */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert-content span {
    line-height: 1.5;
}

.alert-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    transition: all 0.2s ease;
    width: fit-content;
}

.alert-link:hover {
    background: var(--primary-dark);
    transform: translateX(3px);
}

.alert-link i {
    font-size: 0.75rem;
    margin-top: 0;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 0;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}