/* Field Groups */
.sir-field-group {
    margin-bottom: 20px;
    position: relative;
}

/* Labels */
.sir-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sir-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

/* Inputs */
.sir-input,
.sir-select,
.sir-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #111;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.sir-input:focus,
.sir-select:focus,
.sir-textarea:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
}

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

.sir-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M7 7l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Yes/No Buttons */
.sir-yesno {
    display: flex;
    gap: 12px;
}

.sir-yesno-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sir-yesno-option input[type="radio"] {
    display: none;
}

.sir-yesno-option span {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s ease;
    background: #fff;
}

.sir-yesno-option input[type="radio"]:checked + span {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
}

.sir-yesno-option:hover span {
    border-color: #1a365d;
}

/* File Upload */
.sir-file-upload {
    position: relative;
}

.sir-file-input {
    width: 100%;
    padding: 14px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    background: #f9fafb;
    transition: border-color 0.2s ease;
}

.sir-file-input:hover {
    border-color: #1a365d;
}

.sir-file-current {
    margin-top: 8px;
    font-size: 13px;
    color: #276749;
    font-weight: 600;
}

/* Validation */
.sir-field-error {
    border-color: #dc2626 !important;
}

.sir-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

.sir-validation-error .sir-input,
.sir-validation-error .sir-select,
.sir-validation-error .sir-textarea {
    border-color: #dc2626 !important;
    background: #fef2f2;
}

.sir-validation-error .sir-label {
    color: #dc2626;
}

.sir-validation-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.sir-validation-banner strong {
    display: block;
    margin-bottom: 8px;
}

.sir-validation-banner ul {
    margin: 0;
    padding-left: 20px;
}

.sir-validation-banner li {
    margin: 4px 0;
}

/* Saved Indicator */
.sir-saved-indicator {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 12px;
    color: #276749;
    font-weight: 600;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 4px;
    transition: opacity 0.5s ease;
}

.sir-saved-fade {
    opacity: 0;
}

/* Other input for select_other */
.sir-other-input {
    margin-top: 8px;
}

/* Address grid */
.sir-address-group .sir-field-group {
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .sir-address-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .sir-address-group .sir-field-group:first-child {
        grid-column: 1 / -1;
    }

    .sir-address-group .sir-group-label {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .sir-yesno {
        flex-direction: column;
    }
}
