/**
 * Sistema de Tickets - Clínica
 * Estilos principales
 */

:root {
    --primary-color: #2A499C;
    --primary-dark: #1e3570;
    --primary-light: #3d5fb8;
    --secondary-color: #f8f9fa;
    --text-dark: #1a1a1a;
    --text-light: #6c757d;
    --border-color: #e0e0e0;
    --error-color: #dc3545;
    --success-color: #28a745;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container de autenticación */
.auth-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3rem 0;
    position: relative;
    overflow: hidden;
}

.auth-branding {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 2rem 0;
    text-align: center;
    color: var(--white);
    overflow: visible;
}

.auth-text-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease 0.3s both;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.auth-image-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    margin: 0;
    z-index: 1;
    min-height: 0;
    pointer-events: none;
}

.auth-image {
    width: 70%;
    height: auto;
    max-width: 70%;
    max-height: none;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
    animation: fadeInUp 0.8s ease;
    border-radius: 8px;
    display: block;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

.auth-features {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0.75rem auto 0;
    padding-bottom: 3rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s ease 0.5s both;
}

.feature-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.5rem;
    color: var(--white);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.feature-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Estilos específicos para register - cards en columnas */
.auth-features-register {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
    max-width: 400px !important;
}

.auth-features-register .feature-item {
    padding: 1rem 1.25rem !important;
    width: 100% !important;
    justify-content: flex-start !important;
    white-space: normal !important;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}


.logo-container {
    margin-bottom: 2rem;
    display: inline-block;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.auth-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease 0.4s both;
}



.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
}

.auth-form-container {
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-form-header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Alertas */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background-color: #fee;
    color: var(--error-color);
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: var(--success-color);
    border: 1px solid #cfc;
}

.alert svg {
    flex-shrink: 0;
}

/* Formularios */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-dark);
}

/* Asegurar espacio adecuado entre icono y texto */
.input-wrapper:has(.input-icon) input {
    padding-left: 3.75rem;
}

/* Espacio adicional cuando hay icono */
.input-wrapper .input-icon + input,
.input-wrapper input:has(+ .input-icon) {
    padding-left: 3.75rem;
}

/* Espacio adicional para iconos más grandes */
.input-wrapper .input-icon {
    left: 1rem;
    width: 20px;
    height: 20px;
}

/* Asegurar espacio suficiente para iconos en modales */
.modal .input-wrapper input,
.modal .input-wrapper select {
    padding-left: 3.75rem;
}

/* Asegurar espacio en profile y otros formularios */
.profile-content .input-wrapper input,
.auth-form .input-wrapper input {
    padding-left: 3.75rem;
}

/* Asegurar que los inputs con iconos tengan suficiente espacio */
.profile-content .input-wrapper:has(.input-icon) input,
.auth-form .input-wrapper:has(.input-icon) input {
    padding-left: 3.75rem;
}

.modal .input-wrapper:has(.btn-validate-cedula) input {
    padding-right: 3.5rem;
}

/* Estilos para select dentro de input-wrapper */
.input-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    cursor: pointer;
}

.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 73, 156, 0.1);
}

/* Ajustar padding-right cuando hay botones a la derecha */
.input-wrapper:has(.password-toggle) input,
.input-wrapper:has(.btn-validate-cedula) input {
    padding-right: 3.5rem;
}

/* Para navegadores que no soportan :has(), usar clase específica */
.input-wrapper.has-right-button input {
    padding-right: 3.5rem;
}

.input-wrapper input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 73, 156, 0.1);
}

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

.password-toggle,
.btn-validate-cedula {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

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

.btn-validate-cedula {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.btn-validate-cedula:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
    color: white;
}

.btn-validate-cedula:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: var(--text-light);
    color: white;
}

.btn-validate-cedula .spinner {
    animation: spin 1s linear infinite;
}

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

.form-help {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 1;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}

.btn-primary:disabled:hover,
.btn:disabled:hover {
    background: #cccccc !important;
    color: #666666 !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: var(--text-light);
}

.btn-secondary:disabled {
    background: #e0e0e0 !important;
    color: #9e9e9e !important;
    border-color: #d0d0d0 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

.btn-block {
    width: 100%;
}

.btn svg {
    flex-shrink: 0;
}

/* Footer de autenticación */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Dashboard styles moved to dashboard.css */

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-left {
        display: none !important;
    }
    
    .auth-right {
        flex: 1;
        width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .auth-features {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-left {
        display: none !important;
    }
    
    .auth-right {
        padding: 1.5rem 1rem;
    }
    
    .auth-form-header h2 {
        font-size: 1.75rem;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

