/* BAHO Professional Contact Form Styles - Version 1.7 */

/* Reset and Base Styles */
.baho-contact-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Container */
.baho-contact-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    line-height: 1.6;
    width: 100%;
}

/* Form Elements */
.form-group {
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #334155;
    font-size: 15px;
}

.form-group label i {
    color: #1e40af;
    width: 20px;
    text-align: center;
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: inherit;
    transition: all 0.3s ease;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 15px;
    width: 100%;
    color: #1e293b;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: #ffffff;
    transform: translateY(-1px);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Character Counter */
.char-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    font-weight: 400;
    padding: 0 5px;
}

.char-count .current-chars {
    font-weight: 700;
    color: #1e40af;
    font-size: 14px;
}

.char-count .char-status {
    font-size: 12px;
    font-weight: 500;
}

.char-count.exceeded {
    color: #ef4444;
}

.char-count.exceeded .current-chars {
    color: #ef4444;
}

.char-count.exceeded .char-status {
    color: #ef4444;
    font-weight: 600;
}

/* Security Section */
.security-section {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin: 35px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.security-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.security-header h5 {
    font-size: 18px;
    color: #1e40af;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.security-header h5 i {
    color: #1e40af;
    background: rgba(30, 64, 175, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.security-note {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.security-content {
    margin-top: 15px;
}

/* Math Challenge Only */
.math-challenge {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.math-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.math-label i {
    color: #1e40af;
    background: rgba(30, 64, 175, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 18px;
}

.math-problem {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.math-question {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    background: #f1f5f9;
    padding: 12px 24px;
    border-radius: 10px;
    min-width: 200px;
    text-align: center;
    border: 2px dashed #cbd5e1;
}

.math-input {
    width: 140px !important;
    padding: 14px 20px !important;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.math-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.math-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.math-hint i {
    color: #f59e0b;
    font-size: 14px;
}

.math-error {
    margin-top: 15px;
}

/* Submit Button */
.form-submit {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.submit-btn {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px 45px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-width: 250px;
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.25);
    overflow: hidden;
}

.submit-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.35);
}

.submit-btn:hover:not(:disabled):before {
    left: 100%;
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.25);
}

.submit-btn:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
    box-shadow: none !important;
}

.submit-btn:disabled:before {
    display: none;
}

.btn-icon {
    font-size: 20px;
    transition: all 0.3s ease;
}

.btn-text {
    font-size: 17px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
}

.btn-loader i {
    animation: fa-spin 1s infinite linear;
}

/* Loading state */
.submit-btn.loading .btn-icon,
.submit-btn.loading .btn-text {
    opacity: 0;
    transform: translateY(10px);
}

.submit-btn.loading .btn-loader {
    display: block;
}

.form-note {
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.form-note i {
    color: #10b981;
    font-size: 16px;
    flex-shrink: 0;
}

/* Error Messages */
.field-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

.field-error:before {
    content: "⚠";
    font-size: 16px;
}

.field-error.active {
    opacity: 1;
    animation: slideIn 0.3s ease;
}

/* Status Messages */
.form-status {
    margin-bottom: 25px;
}

.alert {
    padding: 18px 22px;
    border-radius: 12px;
    margin: 0;
    font-size: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    line-height: 1.6;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert:before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-left: 5px solid #10b981;
}

.alert-success:before {
    content: "\f058";
    color: #10b981;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-left: 5px solid #ef4444;
}

.alert-error:before {
    content: "\f06a";
    color: #ef4444;
}

/* Hidden fields */
.hidden-fields {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    width: 0 !important;
    pointer-events: none !important;
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(30, 64, 175, 0.25);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 35px rgba(16, 185, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(30, 64, 175, 0.25);
    }
}

.success-pulse {
    animation: successPulse 0.8s ease;
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .math-problem {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .math-question {
        min-width: auto;
        text-align: center;
    }
    
    .math-input {
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .baho-card {
        border-radius: 12px;
    }
    
    .contact-header,
    .form-content {
        padding: 20px 15px !important;
    }
    
    .contact-item {
        padding: 15px;
    }
    
    .security-section {
        padding: 20px 15px;
        margin: 25px 0;
    }
    
    .math-challenge {
        padding: 20px;
    }
    
    .submit-btn {
        width: 100%;
        min-width: unset;
        padding: 18px 25px;
    }
    
    .form-note {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
        text-align: left;
    }
    
    .alert {
        padding: 15px 18px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .contact-info-grid {
        gap: 12px;
    }
    
    .contact-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .math-question {
        font-size: 16px;
        padding: 10px 15px;
    }
    
    .math-input {
        font-size: 18px;
        padding: 12px 15px !important;
    }
}

/* Print styles */
@media print {
    .baho-contact-container {
        break-inside: avoid;
    }
    
    .submit-btn,
    .form-status,
    .security-section,
    .form-note,
    .hidden-fields {
        display: none !important;
    }
    
    .baho-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .contact-header {
        background: #1a472a !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Accessibility */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

.submit-btn:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

/* Custom scrollbar for textarea */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}