/* Form Container */
.form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.25rem;
}

/* Form Label */
.form-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

[data-theme="dark"] .form-label {
    color: #d1d5db;
}

/* Form Inputs */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover {
    border-color: #d1d5db;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus {
    outline: none;
    border-color: #6E7BFF;
    box-shadow: 0 0 0 3px rgba(110, 123, 255, 0.1);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

[data-theme="dark"] .form-input:hover,
[data-theme="dark"] input[type="text"]:hover,
[data-theme="dark"] input[type="email"]:hover,
[data-theme="dark"] input[type="password"]:hover,
[data-theme="dark"] input[type="number"]:hover,
[data-theme="dark"] input[type="tel"]:hover,
[data-theme="dark"] input[type="url"]:hover,
[data-theme="dark"] input[type="search"]:hover,
[data-theme="dark"] input[type="date"]:hover,
[data-theme="dark"] input[type="time"]:hover,
[data-theme="dark"] input[type="datetime-local"]:hover {
    border-color: #4b5563;
}

/* Textarea */
.form-textarea,
textarea {
    min-height: 120px;
    resize: vertical;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.6;
}

.form-textarea:hover,
textarea:hover {
    border-color: #d1d5db;
}

.form-textarea:focus,
textarea:focus {
    outline: none;
    border-color: #6E7BFF;
    box-shadow: 0 0 0 3px rgba(110, 123, 255, 0.1);
}

[data-theme="dark"] .form-textarea,
[data-theme="dark"] textarea {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

[data-theme="dark"] .form-textarea:hover,
[data-theme="dark"] textarea:hover {
    border-color: #4b5563;
}

/* Select */
.form-select,
select {
    appearance: none;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9375rem;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff 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='%236b7280' d='M6 9L2 5h8z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    color: #1f2937;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-select:hover,
select:hover {
    border-color: #d1d5db;
}

.form-select:focus,
select:focus {
    outline: none;
    border-color: #6E7BFF;
    box-shadow: 0 0 0 3px rgba(110, 123, 255, 0.1);
}

[data-theme="dark"] .form-select,
[data-theme="dark"] select {
    background: #1f2937 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='%239ca3af' d='M6 9L2 5h8z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border-color: #374151;
    color: #f3f4f6;
}

[data-theme="dark"] .form-select:hover,
[data-theme="dark"] select:hover {
    border-color: #4b5563;
}

/* Radio & Checkbox */
.form-radio,
.form-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 1.25rem;
    margin-bottom: 0.75rem;
    user-select: none;
}

.form-radio input,
.form-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.form-radio span,
.form-checkbox span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.625rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    background: #ffffff;
    flex-shrink: 0;
}

.form-checkbox span {
    border-radius: 4px;
}

.form-radio:hover span,
.form-checkbox:hover span {
    border-color: #9ca3af;
}

.form-radio input:checked + span,
.form-checkbox input:checked + span {
    background-color: #6E7BFF;
    border-color: #6E7BFF;
}

.form-radio input:checked + span::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #fff;
    border-radius: 50%;
}

.form-checkbox input:checked + span::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    background: transparent;
    border-radius: 0;
}

.form-radio input:focus + span,
.form-checkbox input:focus + span {
    box-shadow: 0 0 0 3px rgba(110, 123, 255, 0.1);
}

[data-theme="dark"] .form-radio span,
[data-theme="dark"] .form-checkbox span {
    background: #1f2937;
    border-color: #4b5563;
}

[data-theme="dark"] .form-radio:hover span,
[data-theme="dark"] .form-checkbox:hover span {
    border-color: #6b7280;
}

[data-theme="dark"] .form-radio input:checked + span,
[data-theme="dark"] .form-checkbox input:checked + span {
    background-color: #6E7BFF;
    border-color: #6E7BFF;
}
/* ──────────────────────────────────────────────
   Drag and Drop File Upload
   ────────────────────────────────────────────── */

.rsl-dnd {
    border: 2px dashed #ccc;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    width: 100%;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
}

.rsl-dnd:hover {
    border-color: #007bff;
}

.rsl-dnd.dragover {
    border-color: #28a745;
}

.rsl-dnd__message {
    font-size: 1.25rem;
    color: #6c757d;
}

.rsl-dnd__icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.rsl-dnd__preview {
    display: flex;
    flex-wrap: wrap;
}

.rsl-dnd__preview-item {
    position: relative;
    margin: 1rem;
    width: 100px;
    height: 100px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    overflow: hidden;
}

.rsl-dnd__preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rsl-dnd__preview-delete {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
}

/* ──────────────────────────────────────────────
   File Preview for rsl-file-tile
   ────────────────────────────────────────────── */

.rsl-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.rsl-file-preview .rsl-dnd__preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsl-file-preview .rsl-dnd__preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rsl-file-preview .rsl-dnd__preview-file-icon {
    font-size: 2rem;
    color: #9ca3af;
}

.rsl-file-preview .rsl-dnd__preview-file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.25rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsl-file-tile.dragover {
    border-color: #6E7BFF;
    background-color: rgba(110, 123, 255, 0.1);
}

/* Range Input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    outline: none;
    transition: background 0.2s ease;
}

input[type="range"]:hover {
    background: #d1d5db;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #6E7BFF;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #5a67e8;
    box-shadow: 0 3px 8px rgba(110, 123, 255, 0.3);
}

input[type="range"]::-webkit-slider-thumb:active {
    box-shadow: 0 0 0 6px rgba(110, 123, 255, 0.2);
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px rgba(110, 123, 255, 0.2);
}

input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #6E7BFF;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #5a67e8;
    box-shadow: 0 3px 8px rgba(110, 123, 255, 0.3);
}

input[type="range"]::-moz-range-thumb:active {
    box-shadow: 0 0 0 6px rgba(110, 123, 255, 0.2);
}

input[type="range"]::-ms-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #6E7BFF;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    border-radius: 3px;
    height: 6px;
}

input[type="range"]::-ms-track {
    background: transparent;
    border-color: transparent;
    color: transparent;
    height: 6px;
}

input[type="range"]::-ms-fill-lower {
    background: #6E7BFF;
    border-radius: 3px;
}

input[type="range"]::-ms-fill-upper {
    background: #e5e7eb;
    border-radius: 3px;
}

[data-theme="dark"] input[type="range"] {
    background: #374151;
}

[data-theme="dark"] input[type="range"]:hover {
    background: #4b5563;
}

[data-theme="dark"] input[type="range"]::-moz-range-track {
    background: #374151;
}

/* Disabled State */
.disable,
input:disabled,
textarea:disabled,
select:disabled,
.form-input:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9fafb !important;
}

[data-theme="dark"] .disable,
[data-theme="dark"] input:disabled,
[data-theme="dark"] textarea:disabled,
[data-theme="dark"] select:disabled,
[data-theme="dark"] .form-input:disabled {
    background-color: #111827 !important;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group > * {
    position: relative;
}

.input-group input {
    flex: 1;
    border-radius: 6px 0 0 6px;
}

.input-group button,
.input-group .btn {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

/* Input Icons */
.input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input:focus + .input-icon,
input:focus + .input-icon {
    color: #6E7BFF;
}

[data-theme="dark"] .input-icon {
    color: #9ca3af;
}

/* Size Options for Inputs */
input.xs,
.form-input.xs {
    height: 32px;
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
}

input.md,
.form-input.md {
    height: 40px;
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
}

input.lg,
.form-input.lg {
    height: 48px;
    font-size: 1.0625rem;
    padding: 0.75rem 1rem;
}

/* Validation States */
.form-input.input-error,
.input-error,
input.input-error,
textarea.input-error,
select.input-error {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.form-input.input-error:focus,
.input-error:focus,
input.input-error:focus,
textarea.input-error:focus,
select.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-input.input-success,
.input-success,
input.input-success,
textarea.input-success,
select.input-success {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}

.form-input.input-success:focus,
.input-success:focus,
input.input-success:focus,
textarea.input-success:focus,
select.input-success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.form-input.input-warning,
.input-warning,
input.input-warning,
textarea.input-warning,
select.input-warning {
    border-color: #f59e0b !important;
    background-color: rgba(245, 158, 11, 0.05) !important;
}

.form-input.input-warning:focus,
.input-warning:focus,
input.input-warning:focus,
textarea.input-warning:focus,
select.input-warning:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* Helper Text */
.form-help {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-error-message {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-success-message {
    font-size: 0.8125rem;
    color: #10b981;
    margin-top: 0.375rem;
    line-height: 1.4;
}

[data-theme="dark"] .form-help {
    color: #9ca3af;
}

[data-theme="dark"] .form-error-message {
    color: #f87171;
}

[data-theme="dark"] .form-success-message {
    color: #34d399;
}