/**
 * Lead Form - Base Structure
 * 
 * Base layout e typography (no colors - delegate to variants)
 * 
 * @package GeneratePressChild
 * @since 2.7.0
 */

/* Container */
.gp-lead-form {
    max-width: 500px;
    padding: 2rem;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

/* Header */
.gp-lead-form__header {
    margin-bottom: 1.5rem;
}

.gp-lead-form__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.gp-lead-form__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* Form fields */
.gp-lead-form__field {
    margin-bottom: 1.25rem;
}

.gp-lead-form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.required {
    color: #dc2626;
    margin-left: 0.25rem;
}

.gp-lead-form__input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.gp-lead-form__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.gp-lead-form__input--error {
    border-color: #dc2626;
}

.gp-lead-form__input--error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.gp-lead-form__error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #dc2626;
    min-height: 1.25rem;
}

.gp-lead-form__error:empty {
    display: none;
}

/* Checkbox field */
.gp-lead-form__field--checkbox {
    margin-bottom: 1.5rem;
}

.gp-lead-form__checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.gp-lead-form__checkbox {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    flex-shrink: 0;
    cursor: pointer;
}

.gp-lead-form__checkbox-label {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

.gp-lead-form__privacy-link {
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.gp-lead-form__privacy-link:hover {
    opacity: 0.8;
}

/* Honeypot (force hidden) */
.gp-lead-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Form-level error message */
.gp-lead-form__form-error {
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    background-color: #fee;
    border: 1px solid #dc2626;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
}

.gp-lead-form__form-error:empty {
    display: none !important;
}

/* Submit button */
.gp-lead-form__submit-wrapper {
    margin-bottom: 1rem;
}

.gp-lead-form__submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gp-lead-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.gp-lead-form__submit:active:not(:disabled) {
    transform: translateY(0);
}

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

.gp-lead-form__submit-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gp-lead-spinner {
    animation: gp-lead-spin 1s linear infinite;
}

@keyframes gp-lead-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success message */
.gp-lead-form__success {
    text-align: left;
    padding: 1.5rem;
    animation: gp-lead-fadein 0.3s ease;
    background: #fff8e6;
    border: 1px solid #facc15;
    border-radius: 10px;
    color: #0f172a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

@keyframes gp-lead-fadein {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gp-lead-form__success-icon {
    margin: 0 auto 1rem;
    display: block;
}

.gp-lead-form__success-message {
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
    color: #0f172a;
}

.gp-lead-form__success-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.gp-lead-form__success-subtext {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.95rem;
    color: #1f2937;
}

.gp-lead-form__tips {
    margin-top: 1rem;
    padding: 0.9rem;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    color: #1f2937;
}

.gp-lead-form__tips-title {
    font-weight: 700;
    margin: 0 0 0.35rem 0;
}

.gp-lead-form__tips-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
.gp-lead-form__footer {
    text-align: center;
    margin-top: 0.5rem;
}

.gp-lead-form__note {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 640px) {
    .gp-lead-form {
        padding: 1.5rem;
    }
    
    .gp-lead-form__title {
        font-size: 1.25rem;
    }
    
    .gp-lead-form__description {
        font-size: 0.875rem;
    }
    
    .gp-lead-form__input {
        font-size: 16px; /* Prevent iOS zoom */
    }
}

/* Context-specific adjustments */
.gp-lead-form--context-sidebar {
    max-width: 100%;
    padding: 1.5rem;
}

.gp-lead-form--context-exit_intent {
    max-width: 450px;
    margin: 0 auto;
}
