:root {
    /* Aseguramos que existan estas variables si styles.css no las tiene */
    --success: #10b981;
    --error: #ef4444;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--black-blue);
    font-size: 0.9rem;
}

.form-input-container {
    position: relative;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--divider-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--off-white-light);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brown);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 1rem;
    /* Ajustado a var(--divider) para coincidir con el frontend */
    border: 2px solid var(--divider); 
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--off-white-light);
    color: var(--black-blue);
}

.form-control:focus {
    outline: none;
    border-color: var(--brown);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.1);
}

.form-control::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}

/* Specific form control types */
.form-control[type="file"] {
    padding: 0.75rem;
    cursor: pointer;
}

.form-control[type="color"] {
    padding: 0.5rem;
    height: 3rem;
    cursor: pointer;
}

.form-control[type="date"],
.form-control[type="datetime-local"],
.form-control[type="month"],
.form-control[type="time"],
.form-control[type="week"] {
    padding: 0.875rem;
}

.form-control:disabled {
    background-color: var(--divider); /* Ajustado */
    color: var(--text-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Textarea specific */
.form-control.textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Select specific */
.form-control.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='%23575757'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5rem;
    padding-right: 3rem;
}

.form-control.select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b5e3c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--brown);
    cursor: pointer;
}

.form-check-label {
    font-weight: 500;
    color: var(--black-blue);
    cursor: pointer;
}

/* Form Help Text */
.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

.form-text.small {
    font-size: 0.75rem;
}

/* Form Validation States */
.form-control.is-valid {
    border-color: var(--success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.form-control.is-invalid {
    border-color: var(--error);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef4444'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.valid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--success);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--error);
}