/* Moixó Frontend CSS */

.moixo-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--moixo-border-color, #E8E8E8);
}

.moixo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Desktop widths */
.moixo-w-desktop-25 { width: calc(25% - 12px); }
.moixo-w-desktop-33 { width: calc(33.333% - 10px); }
.moixo-w-desktop-50 { width: calc(50% - 8px); }
.moixo-w-desktop-66 { width: calc(66.666% - 10px); }
.moixo-w-desktop-75 { width: calc(75% - 12px); }
.moixo-w-desktop-100 { width: 100%; }

/* Labels */
.moixo-field label {
    font-weight: 500;
    font-size: 14px;
    color: var(--moixo-label-color, #1A1A1A);
}

.moixo-required {
    color: #BC0000;
    margin-left: 2px;
}

/* Description */
.moixo-field-description {
    font-size: 12px;
    color: var(--moixo-description-color, #6B6B6B);
    margin-top: 4px;
}

/* Inputs */
.moixo-field input[type="text"],
.moixo-field input[type="email"],
.moixo-field input[type="tel"],
.moixo-field input[type="number"],
.moixo-field input[type="date"],
.moixo-field textarea,
.moixo-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--moixo-border-color, #E8E8E8);
    border-radius: 6px;
    background-color: var(--moixo-bg-color, #FFFFFF);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.moixo-field input::placeholder,
.moixo-field textarea::placeholder {
    color: var(--moixo-placeholder-color, #9A9A9A);
}

.moixo-field input:focus,
.moixo-field textarea:focus,
.moixo-field select:focus {
    outline: none;
    border-color: #3568B2;
    box-shadow: 0 0 0 3px rgba(53, 104, 178, 0.1);
}

.moixo-field textarea {
    resize: vertical;
    min-height: 100px;
}

.moixo-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239A9A9A' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Checkbox / Radio */
.moixo-checkbox-label,
.moixo-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.moixo-checkbox-group,
.moixo-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moixo-field input[type="checkbox"],
.moixo-field input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3568B2;
    cursor: pointer;
}

/* Tablet */
@media (max-width: 1024px) {
    .moixo-w-tablet-25 { width: calc(25% - 12px); }
    .moixo-w-tablet-33 { width: calc(33.333% - 10px); }
    .moixo-w-tablet-50 { width: calc(50% - 8px); }
    .moixo-w-tablet-66 { width: calc(66.666% - 10px); }
    .moixo-w-tablet-75 { width: calc(75% - 12px); }
    .moixo-w-tablet-100 { width: 100%; }
}

/* Mobile */
@media (max-width: 767px) {
    .moixo-form { gap: 12px; }
    .moixo-w-mobile-50 { width: calc(50% - 6px); }
    .moixo-w-mobile-100 { width: 100%; }
    
    .moixo-field input[type="text"],
    .moixo-field input[type="email"],
    .moixo-field input[type="tel"],
    .moixo-field input[type="number"],
    .moixo-field input[type="date"],
    .moixo-field textarea,
    .moixo-field select {
        padding: 10px 12px;
        font-size: 16px;
    }
}

/* Validation */
.moixo-field input:invalid:not(:placeholder-shown),
.moixo-field textarea:invalid:not(:placeholder-shown) {
    border-color: #BC0000;
}

.moixo-field input:valid:not(:placeholder-shown),
.moixo-field textarea:valid:not(:placeholder-shown) {
    border-color: #4D7669;
}

.moixo-field-error {
    color: #BC0000;
    font-size: 12px;
    margin-top: 4px;
}
