/**
 * Lead Form Styles
 * 
 * Professional styling for lead capture forms
 */

.ldh-lead-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ldh-lead-form__title {
    margin: 0 0 25px 0;
    padding: 0;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.ldh-lead-form__form {
    display: block;
}

.ldh-lead-form__row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.ldh-lead-form__row .ldh-lead-form__field {
    flex: 1;
}

@media (max-width: 600px) {
    .ldh-lead-form__row {
        flex-direction: column;
        gap: 0;
    }
}

.ldh-lead-form__field {
    margin-bottom: 20px;
}

.ldh-lead-form__field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.ldh-lead-form__field .required {
    color: #e74c3c;
    font-weight: bold;
}

.ldh-lead-form__field input[type="text"],
.ldh-lead-form__field input[type="email"],
.ldh-lead-form__field input[type="tel"],
.ldh-lead-form__field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ldh-lead-form__field input:focus,
.ldh-lead-form__field textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.ldh-lead-form__field input.ldh-field-error,
.ldh-lead-form__field textarea.ldh-field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.ldh-lead-form__field textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.ldh-lead-form__turnstile {
    margin: 25px 0;
    text-align: center;
}

.ldh-lead-form__actions {
    text-align: center;
    margin-top: 30px;
}

.ldh-lead-form__submit {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    position: relative;
    font-family: inherit;
}

.ldh-lead-form__submit:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.ldh-lead-form__submit:active {
    transform: translateY(0);
}

.ldh-lead-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ldh-lead-form__loading {
    color: #7f8c8d;
    font-style: italic;
    font-size: 14px;
}

.ldh-lead-form__messages {
    margin-top: 20px;
}

.ldh-lead-form__message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.ldh-lead-form__message--success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ldh-lead-form__message--error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ldh-lead-form__message p {
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ldh-lead-form {
        padding: 20px;
        margin: 10px;
    }

    .ldh-lead-form__title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .ldh-lead-form__field input,
    .ldh-lead-form__field textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .ldh-lead-form__submit {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
}

/* Accessibility Improvements */
.ldh-lead-form__field input:focus,
.ldh-lead-form__field textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ldh-lead-form__submit {
        transition: none;
    }

    .ldh-lead-form__submit:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ldh-lead-form {
        border: 2px solid #000000;
    }

    .ldh-lead-form__field input,
    .ldh-lead-form__field textarea {
        border: 2px solid #000000;
    }

    .ldh-lead-form__submit {
        border: 2px solid #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ldh-lead-form {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .ldh-lead-form__title {
        color: #ecf0f1;
    }

    .ldh-lead-form__field label {
        color: #bdc3c7;
    }

    .ldh-lead-form__field input,
    .ldh-lead-form__field textarea {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }

    .ldh-lead-form__field input:focus,
    .ldh-lead-form__field textarea:focus {
        border-color: #3498db;
        background-color: #3c526e;
    }

    .ldh-lead-form__message--success {
        background-color: #1e4d3a;
        border-color: #2d7a4e;
        color: #a7d7b5;
    }

    .ldh-lead-form__message--error {
        background-color: #4d1e23;
        border-color: #7a2d34;
        color: #d7a7ab;
    }
}

/* Success Message Styles */
.ldh-lead-form-success {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-radius: 8px;
    border: 2px solid #3498db;
    animation: ldh-success-fade-in 0.5s ease-out;
}

@keyframes ldh-success-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ldh-success-icon {
    margin: 0 auto 20px auto;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ldh-success-icon-pulse 0.8s ease-out;
}

@keyframes ldh-success-icon-pulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ldh-success-icon svg {
    color: white;
    width: 32px;
    height: 32px;
}

.ldh-success-title {
    color: #27ae60;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px 0;
    animation: ldh-success-text-in 0.6s ease-out 0.2s both;
}

@keyframes ldh-success-text-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ldh-success-message {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    margin: 0 0 25px 0;
    animation: ldh-success-text-in 0.6s ease-out 0.3s both;
}

.ldh-redirect-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    animation: ldh-success-text-in 0.6s ease-out 0.4s both;
}

.ldh-redirect-message {
    color: #3498db;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

#ldh-countdown {
    display: inline-block;
    min-width: 20px;
    font-weight: 700;
    color: #e74c3c;
}

.ldh-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.ldh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 3px;
    width: 0;
}

@keyframes ldh-countdown {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Responsive success message */
@media (max-width: 480px) {
    .ldh-lead-form-success {
        padding: 30px 15px;
    }
    
    .ldh-success-title {
        font-size: 26px;
    }
    
    .ldh-success-message {
        font-size: 16px;
    }
    
    .ldh-success-icon {
        width: 56px;
        height: 56px;
    }
    
    .ldh-success-icon svg {
        width: 28px;
        height: 28px;
    }
}

/* Dark mode support for success */
@media (prefers-color-scheme: dark) {
    .ldh-lead-form-success {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: #3498db;
    }
    
    .ldh-success-message {
        color: #ecf0f1;
    }
    
    .ldh-redirect-info {
        background: rgba(52, 152, 219, 0.1);
        border-color: rgba(52, 152, 219, 0.3);
    }
}

/* Print styles */
@media print {

    .ldh-lead-form__submit,
    .ldh-lead-form__loading,
    .ldh-lead-form__turnstile {
        display: none;
    }

    .ldh-lead-form {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .ldh-lead-form-success {
        border: 2px solid #000000;
        background: white;
    }
    
    .ldh-success-icon,
    .ldh-progress-bar {
        display: none;
    }
}