/* ========================================================================== 
   REFINED FORMS CSS - Compact & Harmonious
   Beautiful, compact form design that matches the refined design system
   ========================================================================== */

:root {
    /* Form-specific refinements */
    --form-spacing: 0.8rem;
    --form-border-radius: 8px;
    --form-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    --form-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Background - Clean and Subtle */
.form-page-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 1.2rem 0;
}

/* Header Banner - More Compact */
.form-header-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    color: white;
}

.form-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.form-header-title i {
    font-size: 1.2rem;
}

.form-header-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0.3rem 0 0 0;
    font-weight: 400;
}

.form-header-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--form-transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-header-button:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Form Container - Clean and Compact */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: var(--form-shadow);
    padding: 1.8rem;
    border: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
}

/* Form Groups - Tighter Spacing */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-label i {
    font-size: 0.7rem;
    color: #6366f1;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
    font-weight: 700;
}

/* Form Controls - Compact and Clean */
.form-control, .form-select {
    font-size: 0.8rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: var(--form-border-radius);
    background: white;
    transition: var(--form-transition);
    color: #374151;
    line-height: 1.4;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-control:hover, .form-select:hover {
    border-color: #9ca3af;
}

.form-control::placeholder {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Input Groups - Compact */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 2.2rem;
}

.input-group-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.75rem;
    z-index: 2;
}

.form-control:focus + .input-group-icon {
    color: #6366f1;
}

/* Help Text - Smaller and Subtle */
.help-text {
    font-size: 0.65rem;
    color: #6b7280;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.3;
}

.help-text i {
    font-size: 0.6rem;
    color: #3b82f6;
}

/* Validation Messages - Compact */
.validation-message {
    font-size: 0.65rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.validation-message.error {
    color: #ef4444;
}

.validation-message i {
    font-size: 0.6rem;
}

/* Required Fields Note - More Subtle */
.required-fields-note {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--form-border-radius);
    padding: 0.7rem;
    margin-bottom: 1.2rem;
    color: #6366f1;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

.required-fields-note i {
    margin-left: 0.3rem;
    font-size: 0.65rem;
}

/* Form Buttons - Compact and Refined */
.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e5e7eb;
}

.btn-form {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    border: none;
    transition: var(--form-transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    cursor: pointer;
    min-width: 120px;
    justify-content: center;
}

.btn-form i {
    font-size: 0.7rem;
}

.btn-form-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.btn-form-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: white;
    text-decoration: none;
}

.btn-form-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-form-secondary:hover {
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Checkbox Styles - Compact */
.form-check {
    margin-bottom: 0.8rem;
    padding: 0.7rem;
    background: #f9fafb;
    border-radius: var(--form-border-radius);
    border: 1px solid #e5e7eb;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.form-check-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.form-check-label i {
    font-size: 0.7rem;
    color: #6366f1;
}

/* Alert Styles - Compact */
.alert-form-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--form-border-radius);
    padding: 0.7rem;
    margin-bottom: 1rem;
    color: #ef4444;
    font-size: 0.75rem;
}

.alert-form-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--form-border-radius);
    padding: 0.7rem;
    margin-bottom: 1rem;
    color: #10b981;
    font-size: 0.75rem;
}

/* Row Spacing - Tighter */
.row {
    margin-bottom: 0.5rem;
}

.row:last-child {
    margin-bottom: 0;
}

/* Color Picker Specific Styles */
input[type="color"] {
    height: 2.5rem;
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: var(--form-border-radius);
    cursor: pointer;
}

input[type="color"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Enhanced color picker styles */
input[type="color"]:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

/* Color picker container with visual feedback */
.color-picker-container {
    position: relative;
    display: inline-block;
}

.color-picker-container::after {
    content: '🎨';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    opacity: 0.7;
}

/* Color update message animation */
.color-update-message {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Color preview enhancement */
#colorPreview {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#colorPreview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Number Input Styles */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Select Dropdown Styles */
.form-select {
    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 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-left: 2.5rem;
}

/* Responsive Design - Mobile Optimized */
@media (max-width: 768px) {
    .form-page-bg {
        padding: 0.8rem 0;
    }
    
    .form-header-banner {
        padding: 1.2rem 1rem;
        margin-bottom: 1rem;
    }
    
    .form-header-content {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    
    .form-header-title {
        font-size: 1.2rem;
    }
    
    .form-header-subtitle {
        font-size: 0.7rem;
    }
    
    .form-container {
        padding: 1.2rem 1rem;
        margin: 0 0.8rem;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .btn-form {
        width: 100%;
        padding: 0.8rem 1.2rem;
    }
    
    .form-control, .form-select {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .input-group .form-control {
        padding-left: 2.4rem;
    }
    
    .input-group-icon {
        left: 0.8rem;
    }
    
    .form-group {
        margin-bottom: 0.8rem;
    }
    
    .form-check {
        padding: 0.6rem;
    }
}

/* Small Mobile Optimization */
@media (max-width: 480px) {
    .form-header-title {
        font-size: 1.1rem;
    }
    
    .form-container {
        padding: 1rem 0.8rem;
        margin: 0 0.5rem;
    }
    
    .form-label {
        font-size: 0.7rem;
    }
    
    .form-control, .form-select {
        font-size: 0.75rem;
    }
    
    .help-text {
        font-size: 0.6rem;
    }
    
    .validation-message {
        font-size: 0.6rem;
    }
    
    .btn-form {
        font-size: 0.7rem;
        padding: 0.7rem 1rem;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .form-control, .form-select {
        border-width: 2px;
    }
    
    .form-control:focus, .form-select:focus {
        border-width: 2px;
        box-shadow: 0 0 0 2px #6366f1;
    }
    
    .btn-form-primary {
        background: #4f46e5;
        border: 2px solid #4f46e5;
    }
    
    .btn-form-secondary {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .form-header-button,
    .form-buttons {
        display: none !important;
    }
    
    .form-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .form-control, .form-select {
        border: 1px solid #000 !important;
        background: white !important;
    }
}

/* Focus Indicators for Accessibility */
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn-form:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Loading State */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Smooth Scrolling for Form Navigation */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Form Container */
.form-container::-webkit-scrollbar {
    width: 6px;
}

.form-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 3px;
}

.form-container::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
} 