/* ============================================================
   Document Submission - Estilos del formulario publico
   ============================================================ */

.ds-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #333;
    box-sizing: border-box;
}

/* ---- Grupos de campo ---- */

.ds-form-group {
    margin-bottom: 20px;
}

.ds-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #222;
}

.ds-required {
    color: #c0392b;
    margin-left: 2px;
}

.ds-required-note {
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

/* ---- Controles del formulario ---- */

.ds-form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.ds-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

select.ds-form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.ds-file-input {
    padding: 8px 10px;
    cursor: pointer;
    background-color: #f9f9f9;
}

.ds-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

/* ---- Estados de error ---- */

.ds-form-control.ds-has-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

.ds-field-error {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #c0392b;
    font-weight: 500;
}

.ds-field-error:empty {
    display: none;
}

/* ---- Boton de envio ---- */

.ds-form-submit-group {
    margin-top: 24px;
}

.ds-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.ds-btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.ds-btn-primary:hover {
    background-color: #005d8c;
}

.ds-btn-primary:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ds-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ---- Spinner ---- */

.ds-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ds-spin 0.7s linear infinite;
}

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

/* ---- Alertas de resultado ---- */

#ds-form-messages {
    margin-bottom: 20px;
}

.ds-alert {
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.ds-alert-success {
    background-color: #eaf7ea;
    border-color: #2e7d32;
    color: #1b5e20;
}

.ds-alert-error {
    background-color: #fdecea;
    border-color: #c0392b;
    color: #7b1a12;
}

/* ---- hCaptcha aviso admin ---- */

.ds-hcaptcha-warning {
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ---- Espaciado hCaptcha ---- */

.h-captcha {
    margin-bottom: 16px;
}

/* ============================================================
   Responsive - pantallas menores a 600px
   ============================================================ */

@media (max-width: 600px) {
    .ds-form-container {
        padding: 16px;
    }

    .ds-form-control {
        font-size: 16px;
    }

    .ds-btn {
        width: 100%;
        justify-content: center;
    }
}
