/**
 * Ravelli Forms CSS
 */

/* Wrapper */
.ravelli-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Success Message */
.ravelli-success-box {
    padding: 30px;
    text-align: center;
    background: #f0faf0;
    border: 1px solid #c3e6c3;
    border-radius: 4px;
    margin-top: 20px;
}

.ravelli-success h4 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #2e7d32;
}

.ravelli-success p {
    margin: 0;
    font-size: 15px;
}

/* Form Container */
.ravelli-inputs-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Input Fields */
.ravelli-input-field {
    display: flex;
    flex-direction: column;
}

.ravelli-input-field.ravelli-full-width {
    grid-column: 1 / -1;
}

.ravelli-input-field label {
    margin-bottom: 5px;
    font-weight: 500;
}

/* Bas-styles för inputs - dynamisk CSS överskrider dessa */
.ravelli-input,
.ravelli-select,
.ravelli-textarea {
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
    /* Färger, padding, border sätts via dynamisk CSS */
}

.ravelli-input:focus,
.ravelli-select:focus,
.ravelli-textarea:focus {
    outline: none;
}

.ravelli-textarea {
    resize: vertical;
}

.ravelli-file {
    padding: 5px;
}

/* Checkboxes */
.ravelli-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ravelli-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ravelli-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Buttons */
.ravelli-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.ravelli-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    /* Övriga styles sätts via dynamisk CSS */
}

.ravelli-btn-primary {
    /* Färger sätts via dynamisk CSS */
}

.ravelli-btn-secondary {
    /* Färger sätts via dynamisk CSS */
}

.ravelli-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fieldsets (för multistep) */
.ravelli-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

/* Error State */
.ravelli-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c00;
}

/* Debug Panel */
.ravelli-debug-panel {
    margin-top: 20px;
    padding: 20px;
    background: #fff8e1;
    border: 2px solid #dba617;
    border-radius: 4px;
}

/* Error Panel */
.ravelli-error-panel {
    margin-top: 20px;
    padding: 15px;
    background: #fcf0f1;
    border: 2px solid #d63638;
    border-radius: 4px;
    color: #d63638;
}

/* Responsive */
@media (max-width: 768px) {
    .ravelli-inputs-container {
        grid-template-columns: 1fr;
    }

    .ravelli-form-actions {
        flex-direction: column;
    }

    .ravelli-btn {
        width: 100%;
    }
}

/* Small text */
small {
    font-size: 12px;
    color: #666;
}

/* ==========================================
   SIGNUP FORM STYLES
   ========================================== */

/* Radio Group */
.ravelli-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.ravelli-radio {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 12px 15px;
    transition: all 0.2s ease;
    /* Färger sätts via dynamisk CSS */
}

.ravelli-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ravelli-radio input[type="radio"]:checked + .ravelli-radio-mark + .ravelli-radio-text {
    font-weight: 500;
}

.ravelli-radio-mark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
    /* Färger sätts via dynamisk CSS */
}

.ravelli-radio input[type="radio"]:checked + .ravelli-radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    /* Färg sätts via dynamisk CSS */
}

.ravelli-radio-text {
    line-height: 1.4;
    /* Färg och storlek sätts via dynamisk CSS */
}

/* Form Description */
.ravelli-form-description {
    margin: -10px 0 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 4px;
    color: #0c5460;
    font-size: 14px;
}

/* Split Actions (Tillbaka + Komplettera) */
.ravelli-form-actions--split {
    justify-content: space-between;
}

/* Prefilled/readonly fields */
.ravelli-input.ravelli-prefilled {
    background: #f5f5f5;
    color: #666;
}

/* Label styling */
.ravelli-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* Responsive adjustments for signup */
@media (max-width: 768px) {
    .ravelli-form-actions--split {
        flex-direction: row;
    }

    .ravelli-form-actions--split .ravelli-btn {
        width: auto;
        flex: 1;
    }

    .ravelli-radio {
        padding: 10px 12px;
    }

    .ravelli-radio-text {
        font-size: 14px;
    }
}
