/**
 * Secure Contact Form Styles
 * Lightweight, accessible, and responsive
 */

/* Form wrapper */
.scf-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Form container */
.scf-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Title */
.scf-title {
    margin: 0 0 25px 0;
    padding: 0;
    font-size: 1.5em;
    color: #333;
    text-align: center;
    font-weight: 600;
}

/* Honeypot field - hidden from users */
.scf-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Form field container */
.scf-field {
    margin-bottom: 20px;
}

/* Labels */
.scf-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

/* Required indicator */
.scf-field .required {
    color: #dc3545;
    margin-left: 2px;
}

/* Input fields */
.scf-field input[type="text"],
.scf-field input[type="email"],
.scf-field input[type="tel"],
.scf-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}

/* Focus state */
.scf-field input:focus,
.scf-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* Error state */
.scf-field input.scf-field-error,
.scf-field textarea.scf-field-error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.scf-field input.scf-field-error:focus,
.scf-field textarea.scf-field-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Textarea specific */
.scf-field textarea {
    min-height: 120px;
    resize: vertical;
}

/* Error messages */
.scf-error {
    display: block;
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.scf-error.visible {
    opacity: 1;
}

/* Submit button */
.scf-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.scf-submit:hover {
    background-color: #005a87;
}

.scf-submit:active {
    transform: translateY(1px);
}

.scf-submit:disabled {
    background-color: #999;
    cursor: not-allowed;
    transform: none;
}

/* Form messages */
.scf-message {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 0.95em;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.scf-message.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.scf-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.scf-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Placeholder styling */
.scf-field input::placeholder,
.scf-field textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .scf-form-wrapper {
        padding: 10px;
    }
    
    .scf-form {
        padding: 20px;
        border-radius: 6px;
    }
    
    .scf-title {
        font-size: 1.3em;
    }
    
    .scf-field input[type="text"],
    .scf-field input[type="email"],
    .scf-field input[type="tel"],
    .scf-field textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .scf-submit {
        padding: 12px 20px;
    }
}

/* Print styles */
@media print {
    .scf-form-wrapper {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .scf-field input,
    .scf-field textarea {
        border-width: 2px;
    }
    
    .scf-submit {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .scf-field input,
    .scf-field textarea,
    .scf-submit,
    .scf-message,
    .scf-error {
        transition: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .scf-form {
        background: #1e1e1e;
        border-color: #333;
    }
    
    .scf-title {
        color: #eee;
    }
    
    .scf-field label {
        color: #ddd;
    }
    
    .scf-field input,
    .scf-field textarea {
        background-color: #2d2d2d;
        border-color: #444;
        color: #eee;
    }
    
    .scf-field input:focus,
    .scf-field textarea:focus {
        border-color: #5ba0d0;
        box-shadow: 0 0 0 3px rgba(91, 160, 208, 0.25);
    }
    
    .scf-field input::placeholder,
    .scf-field textarea::placeholder {
        color: #888;
    }
}
