/**
 * Moduli PDF - Frontend Styles
 * Prefix: mp-
 */

/* ========================================
   Accessibility - Screen Reader Only
   ======================================== */

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

/* Skip link visibile solo su focus */
.mp-skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 10px 15px;
    margin: 0 0 10px 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: inline-block;
    background: #0080c0;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

/* ========================================
   Base Styles
   ======================================== */

.mp-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.mp-form-title {
    text-align: center;
    margin-bottom: 30px;
    color: #0080c0;
    border-bottom: 2px solid #0080c0;
    padding-bottom: 15px;
}

.mp-form {
    background: #fff;
}

/* ========================================
   Fieldset & Legend
   ======================================== */

.mp-fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fafafa;
}

.mp-legend {
    font-weight: 600;
    color: #333;
    padding: 0 10px;
    background: #fff;
    border-radius: 4px;
}

/* ========================================
   Form Grid
   ======================================== */

.mp-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    margin-bottom: 15px;
}

.mp-form-group {
    padding: 0 10px;
    margin-bottom: 10px;
}

.mp-col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.mp-col-3 { flex: 0 0 25%; max-width: 25%; }
.mp-col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.mp-col-6 { flex: 0 0 50%; max-width: 50%; }
.mp-col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.mp-col-9 { flex: 0 0 75%; max-width: 75%; }
.mp-col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 768px) {
    .mp-col-2, .mp-col-3, .mp-col-4, .mp-col-6,
    .mp-col-8, .mp-col-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================
   Labels & Inputs
   ======================================== */

.mp-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.mp-required {
    color: #c00;
}

.mp-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mp-input:focus {
    border-color: #0080c0;
    box-shadow: 0 0 0 3px rgba(0, 128, 192, 0.15);
}

/* Focus visible per navigazione tastiera */
.mp-input:focus:not(:focus-visible) {
    outline: none;
}

.mp-input:focus-visible {
    outline: 2px solid #0080c0;
    outline-offset: 2px;
}

.mp-input:invalid:not(:placeholder-shown) {
    border-color: #c00;
}

.mp-input-small {
    width: 80px;
}

.mp-error-message {
    display: block;
    color: #c00;
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

/* ========================================
   Checkboxes & Radio Buttons
   ======================================== */

.mp-checkbox-section {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.mp-privacy-link {
    text-decoration: underline !important;
}

.mp-checkbox-label,
.mp-radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
}

.mp-checkbox,
.mp-radio {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mp-radio-group,
.mp-radio-group-inline {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.mp-radio-group {
    flex-direction: column;
    gap: 10px;
}

.mp-radio-group-inline {
    flex-wrap: wrap;
}

/* Checkbox Cards (Step 1) */
.mp-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.mp-checkbox-card {
    display: block;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.mp-checkbox-card:hover {
    border-color: #0080c0;
}

.mp-checkbox-card input:checked + .mp-checkbox-card-content {
    color: #0080c0;
}

.mp-checkbox-card:has(input:checked) {
    border-color: #0080c0;
    background: #f0f8ff;
}

/* Accessibilità: input nascosto ma accessibile da tastiera */
.mp-checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 1;
}

.mp-checkbox-card {
    position: relative;
}

/* Focus visible per checkbox card */
.mp-checkbox-card:has(input:focus-visible) {
    outline: 2px solid #0080c0;
    outline-offset: 2px;
}

.mp-checkbox-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-checkbox-card-content::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
}

.mp-checkbox-card:has(input:checked) .mp-checkbox-card-content::before {
    background: #0080c0;
    border-color: #0080c0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 16px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Checkbox/Radio Grid Variants */
.mp-checkbox-grid-2,
.mp-radio-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mp-checkbox-grid-3,
.mp-radio-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Checkbox Card with embedded fields */
.mp-checkbox-card-with-fields,
.mp-radio-card-with-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mp-checkbox-card-with-fields .mp-checkbox-card-content,
.mp-radio-card-with-fields .mp-radio-card-content {
    margin-bottom: 5px;
}

.mp-card-fields {
    display: flex;
    gap: 10px;
    padding-left: 30px;
}

.mp-card-fields .mp-inline-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.mp-card-fields .mp-inline-field label {
    font-size: 11px;
    color: #666;
}

.mp-card-fields .mp-input {
    padding: 6px 8px;
    font-size: 13px;
}

.mp-card-fields .mp-input-small {
    max-width: 100px;
}

/* Conditional field that appears when checkbox is checked */
.mp-conditional-field {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.mp-conditional-field[hidden] {
    display: none;
}

/* Radio Cards */
.mp-radio-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mp-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.mp-radio-card {
    flex: 1;
    display: block;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.mp-radio-card:hover {
    border-color: #0080c0;
}

.mp-radio-card:has(input:checked) {
    border-color: #0080c0;
    background: #f0f8ff;
}

/* Accessibilità: input nascosto ma accessibile da tastiera */
.mp-radio-card {
    position: relative;
}

.mp-radio-card input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 1;
}

/* Focus visible per radio card */
.mp-radio-card:has(input:focus-visible) {
    outline: 2px solid #0080c0;
    outline-offset: 2px;
}

.mp-radio-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-radio-card-content::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mp-radio-card:has(input:checked) .mp-radio-card-content::before {
    background: #0080c0;
    border-color: #0080c0;
    box-shadow: inset 0 0 0 4px #fff;
}

.mp-radio-card-title {
    font-weight: 600;
    color: #333;
}

.mp-radio-card-desc {
    font-size: 13px;
    color: #666;
}

/* ========================================
   Radio Stack (lista verticale con campi inline)
   ======================================== */

.mp-radio-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.mp-radio-item:hover {
    border-color: #0080c0;
}

.mp-radio-item:has(input:checked) {
    border-color: #0080c0;
    background: #f0f8ff;
}

.mp-radio-item input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mp-radio-item > span {
    flex-shrink: 0;
    font-weight: 500;
}

.mp-radio-item.mp-radio-with-field {
    flex-wrap: wrap;
}

.mp-radio-item.mp-radio-with-field .mp-input-inline {
    flex: 1;
    min-width: 200px;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.mp-radio-item.mp-radio-with-field .mp-input-inline:focus {
    border-color: #0080c0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 128, 192, 0.2);
}

/* Su schermi piccoli, il campo va sotto */
@media (max-width: 600px) {
    .mp-radio-item.mp-radio-with-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .mp-radio-item.mp-radio-with-field .mp-input-inline {
        width: 100%;
        margin-left: 28px;
        margin-top: 8px;
    }
}

/* ========================================
   Checkbox Stack (per liste di checkbox verticali)
   ======================================== */

.mp-checkbox-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mp-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    line-height: 1.5;
}

.mp-checkbox-item:hover {
    border-color: #0080c0;
    background: #fafafa;
}

.mp-checkbox-item:has(input:checked) {
    border-color: #0080c0;
    background: #f0f8ff;
}

.mp-checkbox-item input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #0080c0;
}

.mp-checkbox-item > span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Focus visible per accessibilità */
.mp-checkbox-item:has(input:focus-visible) {
    outline: 2px solid #0080c0;
    outline-offset: 2px;
}

/* Su schermi piccoli */
@media (max-width: 600px) {
    .mp-checkbox-item {
        padding: 12px 14px;
    }

    .mp-checkbox-item > span {
        font-size: 13px;
    }
}

/* ========================================
   Conditional Fields
   ======================================== */

.mp-conditional-fields,
.mp-conditional-section {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #0080c0;
}

.mp-conditional-fields[hidden],
.mp-conditional-section[hidden] {
    display: none;
}

.mp-inline-field {
    display: inline-block;
    margin-left: 10px;
}

.mp-inline-fields {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

/* ========================================
   Multi-step Form
   ======================================== */

.mp-steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 10px;
    overflow-x: auto;
}

.mp-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.mp-step-item span {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    border-radius: 50%;
    margin-bottom: 5px;
    font-weight: 600;
}

.mp-step-item.mp-step-active {
    color: #0080c0;
}

.mp-step-item.mp-step-active span {
    background: #0080c0;
    color: #fff;
}

.mp-step-item.mp-step-completed span {
    background: #28a745;
    color: #fff;
}

.mp-step[hidden] {
    display: none;
}

.mp-step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.mp-nav-button {
    padding: 12px 30px;
    border: 2px solid #0080c0;
    background: #fff;
    color: #0080c0;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.mp-nav-button:hover {
    background: #0080c0;
    color: #fff;
}

.mp-nav-button[hidden] {
    visibility: hidden;
}

.mp-nav-next {
    margin-left: auto;
}

/* ========================================
   Submit Button
   ======================================== */

.mp-form-actions {
    text-align: center;
    margin-top: 30px;
}

.mp-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 40px;
    background: #0080c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 200px;
}

.mp-submit-button:hover {
    background: #006699;
}

.mp-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mp-button-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-button-loading[hidden] {
    display: none;
}

.mp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mp-spin 0.8s linear infinite;
}

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

/* ========================================
   Messages & Notices
   ======================================== */

.mp-message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.mp-message[hidden] {
    display: none;
}

.mp-message-error {
    background: #fee;
    border: 1px solid #c00;
    color: #c00;
}

.mp-message-success {
    background: #efe;
    border: 1px solid #28a745;
    color: #28a745;
}

.mp-notice {
    padding: 15px;
    background: #fff8e6;
    border: 1px solid #f0c000;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 14px;
}

.mp-help-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.mp-section-text {
    font-size: 14px;
    color: #333;
    margin: 10px 0;
}

/* ========================================
   Summary Section
   ======================================== */

.mp-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mp-summary h4 {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #0080c0;
}

.mp-summary-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px dotted #ddd;
}

.mp-summary-label {
    flex: 0 0 40%;
    font-weight: 500;
    color: #666;
}

.mp-summary-value {
    flex: 1;
    color: #333;
}

/* ========================================
   Utility Classes
   ======================================== */

.mp-mt-3 {
    margin-top: 20px;
}

/* ========================================
   Input readonly
   ======================================== */

.mp-input-readonly {
    background: #f0f0f0;
    cursor: not-allowed;
}

/* ========================================
   Radio Grid (Tipo Richiesta)
   ======================================== */

.mp-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* ========================================
   Help Text Small
   ======================================== */

.mp-help-text-small {
    display: block;
    font-size: 12px;
    color: #636363;
    margin-top: 4px;
}

/* ========================================
   Margin Bottom
   ======================================== */

.mp-mb-2 {
    margin-bottom: 10px;
}

.mp-mb-3 {
    margin-bottom: 15px;
}

/* ========================================
   Input Error State
   ======================================== */

.mp-input-error {
    border-color: #c00 !important;
    background: #fff5f5;
}

/* ========================================
   Error Summary (at top of form)
   ======================================== */

.mp-error-summary {
    background: #fff5f5;
    border: 2px solid #c00;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.mp-error-summary[hidden] {
    display: none;
}

.mp-error-summary h4 {
    color: #c00;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.mp-error-summary ul {
    margin: 0;
    padding: 0 0 0 20px;
}

.mp-error-summary li {
    margin-bottom: 8px;
}

.mp-error-summary a.mp-error-link {
    color: #c00;
    text-decoration: underline;
    font-weight: 500;
}

.mp-error-summary a.mp-error-link:hover {
    color: #900;
    text-decoration: none;
}

/* Error highlight animation */
.mp-error-highlight {
    animation: mp-shake 0.5s ease-in-out;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.5);
    border-radius: 8px;
}

@keyframes mp-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ========================================
   Screen Reader Only
   ======================================== */

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

/* ========================================
   Button Styles (New)
   ======================================== */

.mp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    gap: 8px;
}

.mp-btn:hover {
    transform: translateY(-1px);
}

.mp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mp-btn-primary {
    background: #006699 !important;
    color: #fff;
}

.mp-btn-primary:hover:not(:disabled) {
    background: #006699;
}

.mp-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.mp-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.mp-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.mp-btn-success {
    background: #28a745;
    color: #fff;
}

.mp-btn-success:hover:not(:disabled) {
    background: #218838;
}

.mp-btn[hidden],
.mp-complete-form[hidden] {
    display: none !important;
}

/* ========================================
   Final Step Styles
   ======================================== */

.mp-step-final {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mp-step-final[hidden] {
    display: none;
}

.mp-final-content {
    max-width: 600px;
    margin: 0 auto;
}

.mp-final-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0080c0;
}

.mp-final-header h3 {
    color: #28a745;
    font-size: 24px;
    margin: 0 0 10px 0;
}

.mp-domanda-numero {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.mp-numero-domanda {
    color: #0080c0;
    font-size: 24px;
}

.mp-final-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mp-final-section h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.mp-final-section p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.mp-final-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* File input styling */
.mp-input-file {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.mp-input-file:hover {
    border-color: #0080c0;
}

.mp-input-file:focus {
    outline: none;
    border-color: #0080c0;
}

/* Final Success Message */
.mp-final-success {
    text-align: center;
    padding: 40px 20px;
}

.mp-final-success h3 {
    color: #28a745;
    font-size: 28px;
    margin: 0 0 20px 0;
}

.mp-final-success p {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px 0;
}

.mp-final-success strong {
    color: #0080c0;
}

/* ========================================
   Reduced Motion - Accessibilità
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .mp-input,
    .mp-checkbox-card,
    .mp-radio-card,
    .mp-nav-button,
    .mp-submit-button,
    .mp-btn,
    .mp-radio-card-content::before {
        transition: none;
    }

    .mp-spinner {
        animation: none;
    }

    .mp-error-highlight {
        animation: none;
    }

    /* Mantieni solo il box-shadow per l'evidenziazione errori */
    .mp-error-highlight {
        box-shadow: 0 0 0 4px rgba(204, 0, 0, 0.5);
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .mp-form-wrapper {
        max-width: none;
    }

    .mp-submit-button,
    .mp-step-navigation,
    .mp-step-final {
        display: none;
    }
}

/* ========================================
   Final Step Buttons - Force White Text
   ======================================== */

.mp-step-final .mp-back-to-form,
.mp-step-final .mp-submit-final,
.mp-step-final .mp-download-pdf,
.mp-step-final .mp-btn-primary,
.mp-step-final .mp-btn-success {
    color: #fff !important;
}

.mp-step-final .mp-back-to-form:hover,
.mp-step-final .mp-submit-final:hover,
.mp-step-final .mp-download-pdf:hover,
.mp-step-final .mp-btn-primary:hover,
.mp-step-final .mp-btn-success:hover {
    color: #fff !important;
}

/* ========================================
   Autocomplete Comuni
   ======================================== */

.mp-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.mp-autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mp-autocomplete-suggestions[hidden] {
    display: none;
}

.mp-autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.mp-autocomplete-item:last-child {
    border-bottom: none;
}

.mp-autocomplete-item:hover,
.mp-autocomplete-item.active {
    background: #f0f7ff;
    color: #0080c0;
}

.mp-autocomplete-loading {
    padding: 12px;
    text-align: center;
    color: #666;
    font-style: italic;
    cursor: default;
}

.mp-autocomplete-loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: #0080c0;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    animation: mp-spin 0.8s linear infinite;
}

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

.mp-autocomplete-no-results {
    padding: 12px;
    text-align: center;
    color: #999;
    font-style: italic;
    cursor: default;
}

/* Select provincia styling */
.mp-provincia-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.mp-provincia-select:focus {
    outline: none;
    border-color: #0080c0;
    box-shadow: 0 0 0 2px rgba(0, 128, 192, 0.2);
}

