/**
 * AffiTrack Form Styles
 * CSS cho form tracking và styling
 */

/* Form Container */
.affitrack-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Form Header */
.affitrack-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.affitrack-form-header h2 {
    color: #1a202c;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.affitrack-form-header p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

/* Form Fields */
.affitrack-form-group {
    margin-bottom: 20px;
}

.affitrack-form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.affitrack-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.affitrack-form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.affitrack-form-input.error {
    border-color: #ef4444;
}

.affitrack-form-input.success {
    border-color: #10b981;
}

/* Textarea */
.affitrack-form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select */
.affitrack-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: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Checkbox & Radio */
.affitrack-form-checkbox,
.affitrack-form-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.affitrack-form-checkbox input,
.affitrack-form-radio input {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

.affitrack-form-checkbox label,
.affitrack-form-radio label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* Submit Button */
.affitrack-form-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.affitrack-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

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

.affitrack-form-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading State */
.affitrack-form-submit.loading {
    position: relative;
    color: transparent;
}

.affitrack-form-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error Messages */
.affitrack-form-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.affitrack-form-error::before {
    content: '⚠️';
    font-size: 12px;
}

/* Success Messages */
.affitrack-form-success {
    color: #10b981;
    font-size: 14px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.affitrack-form-success::before {
    content: '✅';
    font-size: 12px;
}

/* Form Grid */
.affitrack-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .affitrack-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Required Field Indicator */
.affitrack-form-label.required::after {
    content: ' *';
    color: #ef4444;
}

/* Hidden Fields */
.affitrack-form-hidden {
    display: none !important;
}

/* Form Validation Styles */
.affitrack-form-input:invalid {
    border-color: #ef4444;
}

.affitrack-form-input:valid {
    border-color: #10b981;
}

/* Responsive Design */
@media (max-width: 640px) {
    .affitrack-form-container {
        padding: 20px;
        margin: 10px;
    }
    
    .affitrack-form-header h2 {
        font-size: 24px;
    }
    
    .affitrack-form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .affitrack-form-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .affitrack-form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .affitrack-form-input:focus {
        border-color: #6366f1;
    }
    
    .affitrack-form-label {
        color: #d1d5db;
    }
}

/* Animation Classes */
.affitrack-form-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Progress Indicator */
.affitrack-form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.affitrack-form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.affitrack-form-step {
    position: relative;
    z-index: 2;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.affitrack-form-step.active {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
}

.affitrack-form-step.completed {
    border-color: #10b981;
    background: #10b981;
    color: white;
} 