/* --- PQRSFD Form Styles --- */

/* Page Hero */
.pqrs-hero {
    background: linear-gradient(135deg, #003a7a 0%, #0056b3 100%);
    padding: 70px 5% 90px;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pqrs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5v10M30 45v10M5 30h10M45 30h10' stroke='rgba(255,255,255,0.04)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
}

.pqrs-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.pqrs-hero-content h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 12px;
}

.pqrs-hero-content p {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.6;
}

.pqrs-hero .hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 1;
}

.pqrs-hero .hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
    fill: var(--bg-light);
}

/* Form Container */
.pqrs-form-section {
    padding: 60px 5% 80px;
}

.pqrs-form-wrapper {
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Form Header with Logo */
.form-header {
    text-align: center;
    padding: 40px 40px 30px;
    border-bottom: 1px solid #eef2f5;
}

.form-header img {
    height: 60px;
    margin-bottom: 15px;
}

.form-header h2 {
    color: var(--accent-color);
    font-size: 24px;
    margin-bottom: 5px;
}

.form-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* Form Body */
.form-body {
    padding: 40px;
}

/* Field Groups */
.field-group {
    margin-bottom: 35px;
}

.field-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-light);
}

.field-group-title h3 {
    font-size: 17px;
    color: var(--primary-color);
    font-weight: 600;
}

.field-group-title .group-icon {
    width: 28px;
    height: 28px;
    background: rgba(0, 86, 179, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.field-group-title .group-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Grid Layouts */
.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fields-row.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

.field-full {
    grid-column: 1 / -1;
}

/* Form Fields */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-field label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #dde3ea;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: var(--text-dark);
    background-color: #fafbfc;
    transition: all 0.25s ease;
    outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.08);
}

/* Validation states */
.form-field input:valid:not(:placeholder-shown),
.form-field select:valid:not([value=""]),
.form-field textarea:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

.form-field input:invalid:not(:placeholder-shown):not(:focus),
.form-field textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #dc3545;
}

.form-field .field-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.form-field .field-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    display: none;
}

.form-field.has-error .field-error {
    display: block;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

/* Textarea */
.form-field textarea {
    min-height: 160px;
    resize: vertical;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.char-counter.warning {
    color: #e67e22;
}

.char-counter.danger {
    color: #dc3545;
    font-weight: 600;
}

/* Select */
.form-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Radio Buttons — Tipo de requerimiento */
.tipo-requerimiento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tipo-radio {
    position: relative;
}

.tipo-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tipo-radio label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1.5px solid #dde3ea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    background: #fafbfc;
    transition: all 0.25s ease;
    text-align: center;
    margin-bottom: 0;
}

.tipo-radio input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background: rgba(0, 86, 179, 0.06);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.tipo-radio label:hover {
    border-color: var(--secondary-color);
    background: rgba(93, 160, 210, 0.04);
}

/* Representative Toggle Section */
.representative-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.representative-section.active {
    max-height: 600px;
    opacity: 1;
    margin-top: 15px;
    margin-bottom: 35px;
}

.representative-card {
    background: #f8f9fc;
    border: 1px dashed var(--secondary-color);
    border-radius: 16px;
    padding: 30px;
}

.representative-card .field-group-title {
    border-bottom-color: rgba(93, 160, 210, 0.2);
}

/* Tooltip */
.tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
}

.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: var(--white);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
    max-width: 280px;
    white-space: normal;
    line-height: 1.4;
}

.tooltip-trigger:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Checkbox + Privacy Policy */
.privacy-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #eef2f5;
    margin-bottom: 25px;
}

.privacy-section input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.privacy-section label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    line-height: 1.5;
}

.privacy-section a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.privacy-section a:hover {
    color: var(--accent-color);
}

/* Submit Button */
.submit-wrapper {
    text-align: center;
    padding-top: 10px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 50px;
    background: linear-gradient(135deg, #003a7a 0%, #0056b3 100%);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 86, 179, 0.3);
}

.btn-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-submit.loading {
    pointer-events: none;
    position: relative;
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Success / Error Messages */
.form-message {
    display: none;
    padding: 40px;
    text-align: center;
}

.form-message.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.form-message.success .message-icon {
    width: 70px;
    height: 70px;
    background: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.form-message.success .message-icon svg {
    width: 35px;
    height: 35px;
    fill: #28a745;
}

.form-message h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.form-message p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 8px;
}

.radicado-display {
    display: inline-block;
    background: linear-gradient(135deg, #003a7a, #0056b3);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 15px 0;
}

.error-banner {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: none;
}

.error-banner.active {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.error-banner svg {
    width: 22px;
    height: 22px;
    fill: #dc3545;
    flex-shrink: 0;
}

.error-banner p {
    color: #721c24;
    font-size: 14px;
    margin: 0;
}

/* Honeypot — Hidden from humans */
.ohnohoney {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    tab-index: -1;
}

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

/* Responsive */
@media (max-width: 768px) {
    .pqrs-hero {
        padding: 50px 5% 70px;
    }
    .pqrs-hero-content h1 {
        font-size: 28px;
    }
    .form-body {
        padding: 25px 20px;
    }
    .form-header {
        padding: 30px 20px 20px;
    }
    .fields-row,
    .fields-row.three-cols {
        grid-template-columns: 1fr;
    }
    .tipo-requerimiento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .representative-card {
        padding: 20px 15px;
    }
    .privacy-section {
        padding: 15px;
    }
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
    .pqrs-hero .hero-wave svg {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .tipo-requerimiento-grid {
        grid-template-columns: 1fr;
    }
    .radicado-display {
        font-size: 18px;
        padding: 10px 20px;
    }
}
