/**
 * forms.css - Contact form and form elements
 * Contact page form styling and form components
 */

/* ==========================================================================
   CONTACT FORM STYLES
   ========================================================================== */

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.contact-intro {
    background: #e8f4fd;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.contact-intro h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.contact-intro p {
    color: #34495e;
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.contact-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control.error {
    border-color: #e74c3c;
}

.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* Button loading states */
.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

/* ==========================================================================
   FORM ALERTS & MESSAGES
   ========================================================================== */

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-success h3 {
    color: #155724;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-error h3 {
    color: #721c24;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 5px;
}

.alert p {
    margin: 0;
}

/* ==========================================================================
   FORM VALIDATION & FEEDBACK
   ========================================================================== */

.form-feedback {
    font-size: 0.875em;
    margin-top: 5px;
}

.invalid-feedback {
    color: #e74c3c;
}

.valid-feedback {
    color: #27ae60;
}

.character-count {
    font-size: 0.9em;
    color: #6c757d;
    text-align: right;
    margin-top: 5px;
}

.character-count.warning {
    color: #f39c12;
    font-weight: 500;
}

.character-count.error {
    color: #e74c3c;
    font-weight: 600;
}

/* ==========================================================================
   FORM INPUT ENHANCEMENTS
   ========================================================================== */

.input-group {
    position: relative;
}

.input-group-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1.1em;
}

.input-group .form-control {
    padding-left: 40px;
}

.form-help {
    font-size: 0.875em;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.form-help a {
    color: #3498db;
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

/* Required field indicator */
.required::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

/* ==========================================================================
   CHECKBOX & RADIO STYLES
   ========================================================================== */

.form-check {
    margin-bottom: 15px;
    position: relative;
    padding-left: 30px;
}

.form-check-input {
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1.4;
    margin-bottom: 0;
    font-weight: normal;
}

.form-check-input:focus + .form-check-label {
    text-decoration: underline;
}

/* ==========================================================================
   SELECT DROPDOWN STYLES
   ========================================================================== */

.form-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 8px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

.form-select:focus {
    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='%233498db' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* ==========================================================================
   RESPONSIVE FORM DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .contact-container {
        padding: 15px;
    }
    
    .contact-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .contact-intro {
        padding: 20px;
    }
    
    .contact-form {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 1em;
    }
}

/* ==========================================================================
   FORM ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .btn,
    .form-control {
        transition: none;
    }
    
    .button-loading-spinner {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .form-control {
        border-color: #000;
        border-width: 2px;
    }
    
    .form-control:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px #000;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .btn-secondary {
        background: #666;
        border: 2px solid #666;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .contact-form {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white !important;
    }
    
    .btn {
        display: none;
    }
    
    .form-control {
        border: 1px solid #000;
        background: white !important;
    }
    
    .alert {
        border: 1px solid #000;
        background: white !important;
        color: #000 !important;
    }
}