/* ========================================
   Variables y Reset General
   ======================================== */
/* Base layout variables and reset moved to tenant_manager/static/tenant_manager/css/base.css */
/* ========================================
   Variables y Reset General
   ======================================== */
/* :root {
    --primary-color: #2563eb;
    --primary-hover: #1e40af;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
} */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: var(--spacing-lg);
}

/* ========================================
   Contenedor Principal
   ======================================== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ========================================
   Header del Formulario
   ======================================== */
.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.form-header .subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ========================================
   Formulario Principal
   ======================================== */
.survey-form {
    padding: var(--spacing-xl);
}

/* ========================================
   Secciones del Formulario
   ======================================== */
.form-section {
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

/* ========================================
   Form Groups y Labels
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.form-group label.required::after,
.required-indicator {
    content: "*";
    color: var(--danger-color);
    margin-left: 0.25rem;
    font-weight: 700;
}

.help-text {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ========================================
   Form Controls
   ======================================== */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:hover:not(:focus) {
    border-color: var(--secondary-color);
}

select.form-control {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5rem;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.textarea-input {
    font-family: inherit;
}

.complaint-textarea {
    min-height: 150px;
}

/* ========================================
   Bloques de Preguntas
   ======================================== */
.question-block {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all 0.2s ease;
}

.question-block:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.question-header {
    margin-bottom: var(--spacing-md);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    line-height: 1.5;
}

.question-input {
    margin-top: var(--spacing-md);
}

/* ========================================
   Rating (Estrellas)
   ======================================== */
.rating-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.rating-stars {
    display: flex;
    gap: var(--spacing-sm);
}

.star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.star-icon {
    width: 2.5rem;
    height: 2.5rem;
    stroke: #fbbf24;
    stroke-width: 2;
    fill: none;
    transition: all 0.2s ease;
}

.star:hover .star-icon,
.star.hover .star-icon {
    fill: #fef3c7;
    transform: scale(1.1);
}

.star.active .star-icon {
    fill: #fbbf24;
    stroke: #f59e0b;
}

.rating-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-height: 1.5rem;
}

/* ========================================
   Options (Radio y Checkbox)
   ======================================== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.option-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: var(--spacing-md);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.option-label {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
}

.option-item:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Sección de Emergencia
   ======================================== */
.emergency-section {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #dc2626;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.emergency-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    text-decoration: none;
    color: #991b1b;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}

.emergency-link:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

.emergency-link:active {
    transform: scale(0.98);
}

.emergency-icon {
    width: 2.5rem;
    height: 2.5rem;
    stroke: #dc2626;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.emergency-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.emergency-text strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: #7f1d1d;
    line-height: 1.3;
}

.emergency-subtext {
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emergency-subtext::before {
    content: "📞";
    font-size: 1.25rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ========================================
   Botones de Acción
   ======================================== */
.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ========================================
   Footer del Formulario
   ======================================== */
/* Footer and admin link styles moved to tenant_manager/static/tenant_manager/css/base.css */
/* .form-footer {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
} */

.form-footer p {
    margin: 0.25rem 0;
}

/* Admin link - visible en el footer */
.admin-link-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.admin-link:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.admin-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.admin-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.7;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .form-header {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .form-header h1 {
        font-size: 1.5rem;
/* Responsive rules for form header moved to tenant_manager/static/tenant_manager/css/base.css */
/* @media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .form-header {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .form-header h1 {
        font-size: 1.5rem;
    }
} */
    }
    
    .survey-form {
        padding: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-number {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .question-block {
        padding: var(--spacing-md);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .rating-stars {
        gap: 0.25rem;
    }
    
    .star-icon {
        width: 2rem;
        height: 2rem;
    }
    
    /* Emergency section responsive */
    .emergency-section {
        padding: var(--spacing-md);
        margin: var(--spacing-lg) 0;
    }
    
    .emergency-link {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .emergency-text {
        text-align: center;
    }
    
    .emergency-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .emergency-text strong {
        font-size: 1rem;
    }
    
    .emergency-subtext {
        font-size: 0.95rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-header h1 {
        font-size: 1.25rem;
    }
    
    .form-header .subtitle {
        font-size: 0.95rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    /* Emergency section extra small screens */
    .emergency-section {
        padding: var(--spacing-sm);
    }
    
    .emergency-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .emergency-text strong {
        font-size: 0.95rem;
    }
    
    .emergency-subtext {
        font-size: 0.875rem;
    }
}

/* ========================================
   Estados y Animaciones
   ======================================== */
.form-control:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.6;
}

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

.question-block {
    animation: fadeIn 0.3s ease forwards;
}

/* ========================================
   Accesibilidad
   ======================================== */
.star:focus,
.option-item:focus-within,
.btn:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Center and style the admin link placed under the survey form */
.admin-link-container {
    text-align: center;
    margin: 1.25rem 0 1.5rem;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    background: transparent; /* keep appearance consistent with surrounding UI */
}

.admin-link:hover {
    text-decoration: none;
    opacity: 0.95;
}

.admin-link .admin-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}