/* ===========================================
   Fojas Notaria - Estilos
   =========================================== */

/* --- Contenedores generales --- */
.fn-form-wrap,
.fn-consulta-wrap {
    max-width: 900px;
    margin: 24px auto;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.fn-title {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #2f5e43;
    color: #2f5e43;
    font-size: 22px;
    font-weight: 600;
}

/* --- Mensaje de acceso denegado con botón regresar --- */
.fn-mensaje-acceso {
    text-align: center;
    padding: 40px 32px;
}

.fn-consulta-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #eef0f2;
}

.fn-consulta-section h4 {
    margin: 0 0 14px 0;
    color: #1a3a2a;
    font-size: 16px;
    font-weight: 600;
}

/* --- Grid de campos --- */
.fn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fn-grid-2 {
    grid-template-columns: 1fr 1fr;
}

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

.fn-field {
    display: flex;
    flex-direction: column;
}

.fn-field label {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.fn-field input,
.fn-field textarea,
.fn-field select {
    padding: 9px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.fn-field input:focus,
.fn-field textarea:focus,
.fn-field select:focus {
    border-color: #2f5e43;
    outline: none;
    box-shadow: 0 0 0 2px rgba(47, 94, 67, 0.15);
}

.fn-field input[readonly] {
    background: #f0f2f4;
    cursor: not-allowed;
    color: #555;
}

.fn-field textarea {
    resize: vertical;
    min-height: 50px;
}

/* --- Fila con checkbox inline (N° Boleta + SIN BOLETA) --- */
.fn-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fn-field-row input[type="text"] {
    flex: 1;
}

.fn-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 5px;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #666 !important;
    white-space: nowrap;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.fn-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

/* --- CAPTCHA --- */
.fn-captcha-label {
    font-size: 15px;
    color: #1f3a2a;
}

.fn-captcha-op {
    font-weight: 700;
    color: #2f5e43;
    font-size: 17px;
}

.fn-captcha-input {
    max-width: 200px;
}

/* --- Botones --- */
.fn-submit-wrap {
    margin-top: 20px;
    text-align: center;
}

.fn-btn {
    display: inline-block;
    padding: 11px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.fn-btn:active {
    transform: scale(0.98);
}

.fn-btn-primary {
    background: #2f5e43;
    color: #fff;
}

.fn-btn-primary:hover {
    background: #234a34;
}

.fn-btn-primary:disabled {
    background: #8aa899;
    cursor: not-allowed;
}

.fn-btn-secondary {
    background: #556b7c;
    color: #fff;
}

.fn-btn-secondary:hover {
    background: #3f5260;
}

.fn-btn-danger {
    background: #b33a3a;
    color: #fff;
}

.fn-btn-danger:hover {
    background: #8f2e2e;
}

.fn-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

/* --- Mensajes --- */
.fn-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.fn-message.fn-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fn-message.fn-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Resultados de consulta --- */
.fn-resultados-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.fn-resultados-tabla th {
    background: #2f5e43;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.fn-resultados-tabla td {
    padding: 9px 12px;
    border-bottom: 1px solid #e8e8e8;
}

.fn-resultados-tabla tr:nth-child(even) td {
    background: #f8faf9;
}

.fn-resultados-tabla tr:hover td {
    background: #eef4f0;
}

/* --- Loading --- */
.fn-loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 15px;
}

.fn-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border: 3px solid #e0e0e0;
    border-top-color: #2f5e43;
    border-radius: 50%;
    animation: fn-spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* --- Responsive --- */
@media (max-width: 600px) {
    .fn-form-wrap,
    .fn-consulta-wrap {
        padding: 18px 16px;
    }

    .fn-grid,
    .fn-grid-2 {
        grid-template-columns: 1fr;
    }

    .fn-field-row {
        flex-direction: column;
        align-items: stretch;
    }
}
