.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.form-group {
    position: relative;
    margin-bottom: 10px;
}

/* Add to your existing CSS */
.form-group input.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-group input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group .error {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

.form-group label {
    position: absolute;
    top: -8px;
    left: 8px;
    background: white;
    color: #303030;
    font-size: 0.8rem;
    padding: 0 4px;
    pointer-events: none;
    font-family: 'Inter';
    font-weight: 500;

}

.form-group input:disabled> {
    background: #ccc;
}

.form-column {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
    gap: 0.75rem;
}

.form-message {
    margin-bottom: 20px;
    border-radius: 5px;
    padding: 15px 10px;
    font-size: 1rem;
}

/* .form-message.error {
    color: red;
    background-color: #ffe6e6;
    border: 1px solid red;
}

.form-message.success {
    color: green;
    background-color: #e6ffe6;
    border: 1px solid green;
} */
.form-message.show {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    animation: fadeSlideIn 200ms ease-out;
}

.form-message.hidden {
    display: none;
}

.form-message.success {
    border: 1px solid #c5e7c8;
    background: #f0fbf1;
    color: #155724;
}

.form-message.error {
    border: 1px solid #f1c0c0;
    background: #fff5f5;
    color: #842029;
}

.form-message .icon {
    width: 24px;
    height: 24px;
    color: currentColor;
}

.form-message .title {
    margin: 0 0 2px;
    font-weight: 600;
    padding: 0;
}

.form-message .text {
    margin: 0;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-message.show {
        animation: none;
    }
}

.form-section h4 {
    margin-bottom: 1rem;
}

.category-container {
    margin-bottom: 2rem;
}

.items-container {
    margin-bottom: 1rem;
}


/* Autocomplete dropdown */
.autocomplete-container {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-main {
    font-weight: bold;
    color: #333;
}

.suggestion-secondary {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.grid-2 {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.grid-3 {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}


.removeDevice {
    background-color: white;
    border: 1px solid #ccc;
    color: black;
}

.duplicateDevice {
    background-color: #3a7700;
}

.removeDevice:hover {
    background-color: #ccc;
}

.duplicateDevice:hover {
    background: #0b7dda;
}

.error {
    color: red;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

div.error:empty {
    display: none;
}

.info {
    color: #093c71;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success {
    color: green;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

select,
textarea,
input,
.choices__inner {
    width: 100%;
    padding: 0.75rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    /* box-shadow: #dfdfdf 0 0 0 1px inset; */
    transition: border-color 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus,
.choices__inner:focus {
    outline: none;
    border-color: #33a0bb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

input:user-invalid {
    border: 2px solid #e74c3c;
}

textarea:disabled,
input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

input:disabled::placeholder {
    color: #ccc;
}

.form-group input:disabled+label,
.form-group textarea:disabled+label {
    color: #ccc;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 50%, rgba(245, 245, 245, 1) 50%);
}

.radio-group {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.radio-option {
    display: flex;
    align-items: baseline;
}

.radio-option input {
    margin-right: 8px;
}

.required::after {
    content: "*";
    color: #e74c3c;
    margin-left: 3px;
}

.checkbox-section {
    background: rgba(252, 252, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.custom-checkbox {
    position: relative;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
    font-size: 0.875rem;

}

.checkmark {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    position: relative;
    transition: all 0.2s ease;
    background: white;
}

.custom-checkbox input:checked+label .checkmark {
    background: #052c96;
    background: #052c96;
}

.custom-checkbox input:checked+label .checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:focus+label .checkmark {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.appointments-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .appointments-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.required {
    color: #dc2626;
}

.datetime-input,
.textarea-input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.datetime-input:focus,
.textarea-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.textarea-input {
    resize: none;
    font-family: inherit;
}

.submit-button:active {
    transform: translateY(0);
}

.help-text {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    padding-top: 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.send-icon {
    width: 1rem;
    height: 1rem;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}

.error-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
}

.info-hint {
    font-size: 0.875rem;
    line-height: 1.5;
    background: rgba(219, 254, 226, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 8px solid #059669;
    margin: 2px 0;
}

.error-description-hint {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    background: rgba(254, 243, 199, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 8px solid #f59e0b;
    margin: 2px 0;
}

.warning-icon {
    width: 1rem;
    height: 1rem;
    color: #f59e0b;
}

.hidden {
    display: none;
}

.error-message {
    color: red;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid red;
    background-color: #ffe6e6;
    border-radius: 5px;
    display: none;
    /* Hidden by default */
}

.item-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.item-footer {
    display: flex;
    justify-content: start;
    gap: 10px;
}

.item-footer button {
    flex-grow: 0;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.modern-file-upload {}

.upload-label {
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #ffffff;
    border: 1.5px dashed #d1d5db;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-label:hover .upload-content {
    border-color: #0c4f96;
    background: #f8fafc;
    cursor: pointer;

}

.upload-label:active .upload-content {
    transform: scale(0.98);
}

.upload-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #0c4f96;
}

.file-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6b7280;
    margin-left: auto;
}

input[type="file"] {
    display: none;
}

/* Upload icon styling */
.upload-content svg {
    width: 20px;
    height: 20px;
    color: #0c4f96;
}

.loading03 span {
    margin: 0 0.2em;
    letter-spacing: 0.05em;
    /* extra space between letters */
    animation: loading03 0.7s infinite alternate;
    animation-delay: calc(var(--i) * 0.05s);
    /* smaller step for long text */
    display: inline-block;
    /* allow transform */
}

.flex-center {
    align-items: center;
    justify-content: center;
}

@keyframes loading03 {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-4px);
    }
}

.loading-message {
    display: inline-block;
    padding: 1rem 1.5rem;
    /* height: 100px;
  border: 1px solid #dee2e6;
  border-radius: 12px; */
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-message::after {
    content: '...';
    animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: '.';
    }

    25% {
        content: '..';
    }

    50% {
        content: '...';
    }

    75% {
        content: '....';
    }

    100% {
        content: '.';
    }
}


@media (max-width: 768px) {
    .upload-content {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .file-name {
        margin-left: 0;
        margin-top: 8px;
    }

    .card-header,
    .card-content,
    .card-footer {
        padding: 1rem;
    }

    .category-container {
        text-align: center;
        justify-content: center;
    }

    .grid-2 {
        display: flex;
        flex-direction: column;
    }

    .grid-3 {
        display: flex;
        flex-direction: column;
    }

    .item-footer {
        flex-direction: column;
        justify-content: center;
    }

}