/* Estilos del Sistema PQR - Aysatec */

/* Variables de colores de Aysatec */
:root {
    --primary-red: #d8383b;
    --primary-red-dark: #c02d30;
    --primary-blue: #1e3a8a;
    --primary-blue-dark: #1e40af;
    --primary-gold: #f59e0b;
    --primary-gold-dark: #d97706;
    --surface-color: #ffffff;
    --surface-color-light: #f8f9fa;
    --text-primary: #464646;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 20px auto;
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 300;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Welcome Section */
.welcome-section {
    padding: 30px;
    background-color: var(--surface-color-light);
    border-bottom: 1px solid var(--border-color);
}

.welcome-section h2 {
    color: var(--text-primary);
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 400;
}

.welcome-text {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-color-light) 100%);
    padding: 20px;
    border-left: 4px solid var(--primary-red);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.welcome-text ul {
    margin-top: 10px;
    padding-left: 20px;
}

.welcome-text li {
    margin-bottom: 5px;
}

/* Form Sections */
.pqr-form {
    padding: 30px;
}

.form-section {
    border: none;
    margin-bottom: 40px;
    padding: 0;
}

.form-section legend {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 20px;
    padding: 0 10px 10px 0;
    border-bottom: 2px solid var(--primary-red);
    width: 100%;
}

/* Form Groups and Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

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

.required {
    color: var(--primary-red);
    font-weight: bold;
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--surface-color);
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(216, 56, 59, 0.1);
    transform: translateY(-1px);
}

input[type="text"]:invalid,
input[type="email"]:invalid,
input[type="tel"]:invalid,
select:invalid {
    border-color: var(--danger-color);
}

input[type="text"]:valid,
input[type="email"]:valid,
input[type="tel"]:valid,
select:valid {
    border-color: var(--success-color);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23464646" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 10px 0;
}

.radio-group label {
    font-weight: normal;
    margin-left: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.radio-group label:hover {
    border-color: var(--primary-red);
    background-color: rgba(216, 56, 59, 0.05);
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--primary-red);
}

.radio-group input[type="radio"]:checked + label,
.radio-group input[type="radio"]:focus + label {
    border-color: var(--primary-red);
    background-color: rgba(216, 56, 59, 0.1);
    color: var(--primary-red);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--primary-red);
    background-color: rgba(216, 56, 59, 0.05);
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-text p:first-child {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.file-upload-text p:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--surface-color-light);
    border-radius: 6px;
    font-size: 14px;
}

#file-list {
    margin-top: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 5px;
}

.file-item .file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-item .file-size {
    color: var(--text-secondary);
    font-size: 12px;
}

.file-item .remove-file {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.file-item .remove-file:hover {
    background-color: #c82333;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.char-counter.warning {
    color: var(--warning-color);
}

.char-counter.danger {
    color: var(--danger-color);
}

/* Help Text */
.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.submit-btn,
.reset-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(216, 56, 59, 0.3);
}

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

.reset-btn {
    background-color: var(--text-secondary);
    color: white;
}

.reset-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-loading {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: flex;
}

.submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Success and Error Messages */
.success,
.error {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: var(--success-color);
    color: #155724;
}

.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--danger-color);
    color: #721c24;
}

.error ul {
    margin-top: 10px;
    padding-left: 20px;
}

.error li {
    margin-bottom: 5px;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-red-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* Footer */
.footer {
    background-color: var(--surface-color-light);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--primary-red);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .welcome-section,
    .pqr-form {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-group label {
        margin-bottom: 10px;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
    }

    .submit-btn,
    .reset-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .success-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8em;
    }

    .welcome-section h2 {
        font-size: 1.5em;
    }

    .form-section legend {
        font-size: 1.2em;
    }

    .file-upload {
        padding: 15px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        padding: 10px 12px;
        font-size: 16px; /* Evita zoom en iOS */
    }
}

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

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

input[type="radio"]:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .form-actions,
    .footer {
        display: none;
    }

    .container {
        box-shadow: none;
        margin: 0;
    }

    .success,
    .error {
        border: 1px solid #000;
    }
}

/* ============================= */
/* ESTILOS PARA ICONOS SVG */
/* ============================= */

/* Animación de rotación para iconos */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estilos base para iconos SVG */
.bi {
    display: inline-block;
    vertical-align: text-bottom;
    fill: currentColor;
}

.bi.spin {
    animation: spin 1s linear infinite;
}

.bi.me-2 {
    margin-right: 0.5rem !important;
}

.bi.me-3 {
    margin-right: 1rem !important;
}

/* Ajustar tamaños de iconos según contexto */
h1 .bi {
    width: 1.5em;
    height: 1.5em;
}

h2 .bi {
    width: 1.25em;
    height: 1.25em;
}

h4 .bi {
    width: 1.125em;
    height: 1.125em;
}

legend .bi {
    width: 1.125em;
    height: 1.125em;
}

button .bi {
    width: 1em;
    height: 1em;
}

p .bi {
    width: 1em;
    height: 1em;
}

/* Placeholder para iconos no encontrados */
.icon-placeholder {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.8em;
}

/* Estilos para reCAPTCHA v2 */
.g-recaptcha {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 78px;
}

/* Asegurar que el reCAPTCHA sea responsivo */
@media (max-width: 576px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center;
        margin: 10px -10px;
    }
} 