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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #6c7293 0%, #8e94b7 100%);
    min-height: 100vh;
    color: #333;
}

/* Header */
.header-main {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Pantalla de selección de modalidad */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-principal {
    width: 240px;
    height: 240px;
    object-fit: contain;
}

.botones-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.btn-opcion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 60px;
    text-transform: none;
}

.btn-opcion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-opcion .material-icons {
    font-size: 20px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-main h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
}

/* Login section */
.login-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.google-icon {
    width: 18px;
    height: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #5f6368;
    font-size: 14px;
}

.btn-logout {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #5f6368;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #f8f9fa;
}

/* Container principal */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Form card */
.form-card {
    background: white;
    border-radius: 8px;
    border: 2px solid #4a5568;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    padding: 2rem;
}

.form-card h2 {
    font-size: 1.75rem;
    font-weight: 400;
    color: #333;
    margin-bottom: 1.5rem;
}

/* Mensaje de éxito */
.mensaje-exito {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form sections */
.form-section {
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a5568;
}

/* Form groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #718096;
    border-radius: 4px;
    font-size: 14px;
    background: #f7fafc;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a5568;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.2);
}

.form-group input[readonly] {
    background: #e2e8f0;
    color: #2d3748;
    border-color: #a0aec0;
}

.form-group select:disabled {
    background: #e2e8f0;
    color: #718096;
    border-color: #a0aec0;
    cursor: not-allowed;
}

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

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-primary {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-primary:hover {
    background: #c82333;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.btn-info {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-info:hover {
    background: #0056b3;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: #218838;
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #764ba2;
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-secondary:hover {
    background: #6a4190;
    box-shadow: 0 6px 16px rgba(118, 75, 162, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn .material-icons {
    font-size: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Nota preview styles */
.nota-contenido {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #000;
}

.nota-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.nota-header h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

.nota-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    position: absolute;
    top: 0;
    right: 0;
}

.nota-fecha {
    margin-bottom: 1.5rem;
    text-align: right;
}

.nota-destinatario {
    margin-bottom: 2rem;
    line-height: 1.5;
}

.nota-destinatario p {
    margin: 0.25rem 0;
}

.nota-cuerpo {
    margin-bottom: 3rem;
    text-align: justify;
}

.nota-cuerpo p {
    margin-bottom: 1rem;
    text-indent: 2rem;
}

.nota-cuerpo p:first-child {
    text-indent: 0;
}

.area-firma-derecha {
    margin-top: 2rem;
    text-align: right;
    width: 50%;
    margin-left: auto;
    margin-right: 0;
}

.firma-linea {
    width: 200px;
    border-bottom: 1px solid #000;
    margin-left: auto;
    margin-right: 0;
    margin-bottom: 0.2rem;
}

.firma-linea-unica {
    width: 300px;
    border-bottom: 1px solid #000;
    margin-left: auto;
    margin-right: 0;
    margin-bottom: 0.5rem;
}

.datos-personales-compactos {
    text-align: right;
}

.datos-personales-compactos p {
    margin: 1px 0;
    line-height: 1.1;
}

/* Animación de fadeIn */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Vista de nota directa */
#vistaNotaDirecta .form-card {
    max-width: 800px;
    margin: 2rem auto;
}

#vistaNotaDirecta .nota-preview {
    background: white;
    padding: 40px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

#vistaNotaDirecta .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#vistaNotaDirecta .btn {
    min-width: 200px;
}

/* Estilos de impresión */
@media print {
    /* Ocultar elementos no imprimibles */
    .no-print {
        display: none !important;
    }
    
    /* Ocultar header */
    .header-main {
        display: none !important;
    }
    
    /* Remover padding y márgenes del body */
    body {
        margin: 0;
        padding: 0;
        background: white;
    }
    
    /* Ajustar contenedor principal */
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Ajustar card del formulario */
    .form-card {
        box-shadow: none;
        margin: 0;
        padding: 0;
        background: white;
    }
    
    /* Ajustar nota preview */
    .nota-preview {
        box-shadow: none !important;
        border: none !important;
        padding: 20px !important;
        margin: 0 !important;
    }
    
    /* Asegurar que los botones no se vean */
    .form-actions {
        display: none !important;
    }
    
    button {
        display: none !important;
    }
    
    /* Centrar línea de firma solo en PDF */
    .firma-linea {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-main h1 {
        font-size: 1.25rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    /* Centrar datos personales solo en vista móvil */
    .area-firma-derecha {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center !important;
    }
    
    .area-firma-derecha .datos-personales-compactos {
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .form-card {
        padding: 1.5rem 1rem;
    }
    
    .header-main h1 {
        font-size: 1rem;
    }
}