/* =========================
   FORMS
   ========================= */

.modern-form {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
}

/* Glassmorphism container for actual forms */
.form-glassmorphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 20px -8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    color: #086973;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

    .form-section-title::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 60px;
        height: 2px;
        background: linear-gradient(135deg, #086973, #0891b2);
    }

.form-control {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-control,
.form-select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
}

    .form-control:focus {
        border-color: #086973;
        box-shadow: 0 0 0 0.2rem rgba(8, 105, 115, 0.25);
        background: white;
    }

.form-select {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fafbfc;
}

.form-select:focus {
    border-color: #086973;
    box-shadow: 0 0 0 0.2rem rgba(8, 105, 115, 0.25);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control-sm {
    min-height: 44px;
    font-size: 16px;
    padding: 0.5rem;
}

/* Form rows - stack everything */
.row.mb-4 > [class*="col-"] {
    margin-bottom: 1rem !important;
}

    .row.mb-4 > [class*="col-"]:last-child {
        margin-bottom: 0 !important;
    }

@media (max-width: 768px) {
    .modern-form .nav-tabs {
        font-size: 0.9rem;
    }

        .modern-form .nav-tabs .nav-link {
            padding: 0.75rem 1rem;
            border-radius: 0.5rem 0.5rem 0 0;
        }

    .modern-form .tab-content {
        margin-top: 1.5rem !important;
    }    .modern-form .dropdown-toggle {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.75rem;
        min-height: 48px;
    }

    .modern-form .form-control[type="file"] {
        padding: 1rem;
        border: 2px dashed #e2e8f0;
        border-radius: 0.75rem;
        background: #f8fafc;
        min-height: 60px;
    }

        .modern-form .form-control[type="file"]:focus {
            border-color: var(--color-primary);
            border-style: solid;
        }
}

@media (max-width: 576px) {
    .modern-form {
        padding: 1rem;
        border-radius: 0.75rem;
    }

        .modern-form .page-title {
            font-size: 1.5rem;
            text-align: center;
            margin-bottom: 1.5rem;
        }

        .modern-form .nav-tabs {
            border: none;
            background: #f8fafc;
            padding: 0.25rem;
            border-radius: 0.75rem;
            margin-bottom: 1rem;
        }

            .modern-form .nav-tabs .nav-item {
                flex: 1;
            }

            .modern-form .nav-tabs .nav-link {
                text-align: center;
                border: none;
                background: transparent;
                margin: 0;
                padding: 0.75rem 0.5rem;
                border-radius: 0.5rem;
                transition: all 0.3s ease;
            }

                .modern-form .nav-tabs .nav-link.active {
                    background: white;
                    color: var(--color-primary);
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                }        .modern-form .dropdown-menu {
            border-radius: 0.75rem;
            border: 2px solid #e2e8f0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            padding: 0.5rem 0;
            margin-top: 0.5rem;
        }

        .modern-form .dropdown-item {
            padding: 1rem 1.25rem;
            border-radius: 0;
            transition: background-color 0.2s ease;
        }

            .modern-form .dropdown-item:hover {
                background-color: #f8fafc;
            }

        .modern-form .form-check-input {
            width: 1rem !important;
            height: 1rem !important;
            margin-right: 0.5rem !important;
        }

        .modern-form .dropdown-item.d-flex {
            align-items: flex-start !important;
            min-height: 48px !important;
        }

        .modern-form .dropdown-item span {
            line-height: 1.4 !important;
            padding-top: 0.125rem;
        }

        .modern-form .btn-primary {
            padding: 1rem;
            font-size: 1.1rem;
            font-weight: 600;
            border-radius: 0.75rem;
            min-height: 48px;
            box-shadow: 0 2px 4px rgba(8, 105, 115, 0.3);
            transition: all 0.3s ease;
        }

            .modern-form .btn-primary:hover {
                transform: translateY(-1px);
                box-shadow: 0 4px 8px rgba(8, 105, 115, 0.4);
            }

        .modern-form .mb-3 {
            margin-bottom: 1.5rem !important;
        }

        .modern-form .form-label {
            font-weight: 600;
            color: var(--color-text-dark);
            margin-bottom: 0.75rem;
            font-size: 1rem;
        }
}

@media (min-width: 768px) and (max-width: 1024px) {

    .modern-form {
        max-width: 700px;
        margin: 1rem auto;
        padding: 1.5rem;
    }

        .modern-form .nav-tabs .nav-link {
            padding: 1rem 1.5rem;
            font-size: 1rem;
        }        .modern-form .dropdown-toggle {
            padding: 0.875rem 1rem;
        }

        .modern-form .form-check-input {
            width: 1.1rem;
            height: 1.1rem;
        }
}

@media (max-width: 896px) and (orientation: landscape) {

    .modern-form {
        padding: 1rem;
    }

        .modern-form .page-title {
            font-size: 1.25rem;
            margin-bottom: 1rem;
        }

        .modern-form .nav-tabs {
            margin-bottom: 0.75rem;
        }

            .modern-form .nav-tabs .nav-link {
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
            }
}

/* =========================
   MOBILE FORM ENHANCEMENTS
   ========================= */

@media (max-width: 767.98px) {
    /* Mobile form container - add bottom padding for fixed buttons */
    .modern-form {
        padding-bottom: 120px !important; /* Space for fixed bottom buttons */
        margin-bottom: 2rem;
    }
    
    /* Ensure form content doesn't get hidden behind fixed buttons */
    .form-section {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }
    
    /* Last form section needs extra bottom padding */
    .form-section:last-child {
        padding-bottom: 140px !important;
    }
    
    /* Column stacking */
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .col-md-12 {
        margin-bottom: 1rem;
    }
    
    /* Remove bottom margin from last column */
    .row > [class*="col-"]:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Form spacing */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Form labels */
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    /* Totals card - full width */
    .col-md-6.offset-md-6 {
        margin-left: 0 !important;
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Accessibility & usability improvements */
.modern-form .nav-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.modern-form .dropdown-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.modern-form .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.modern-form .form-control[type="file"] {
    position: relative;
    overflow: hidden;
}

    .modern-form .form-control[type="file"]::-webkit-file-upload-button {
        background: var(--color-primary);
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        margin-right: 1rem;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

        .modern-form .form-control[type="file"]::-webkit-file-upload-button:hover {
            background: var(--color-primary-hover);
        }

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-form .dropdown-menu {
    animation: dropdownFadeIn 0.2s ease-out;
}

/* Modern Select Dropdown */
.modern-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.3s ease;
    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.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.modern-select:focus {
    outline: none;
    border-color: #086973;
    box-shadow: 0 0 0 3px rgba(8, 105, 115, 0.1);
}

.modern-select:hover {
    border-color: #94a3b8;
}

/* Modern Switch */
.modern-switch {
    position: relative;
}

.switch-label {
    flex: 1;
}

.form-check-input:checked {
    background-color: #086973;
    border-color: #086973;
}