/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #de0500;
    --primary-dark: #b91c1c;
    --primary-ultra-light: rgba(222, 5, 0, 0.05);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --success: #10b981;
    --purple: #8b5cf6;
    --purple-dark: #7c3aed;
    --green: #10b981;
    --green-dark: #059669;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px 0 rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px 0 rgba(0, 0, 0, 0.04);
}

/* V2 Badge Centered Above Headline */
.v2-badge-centered {
    display: inline-block;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
        transform: scale(1.05);
    }
}

/* Test Brand Extraction Button */
.test-brand-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.test-brand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.test-brand-btn:active {
    transform: translateY(0);
}

.test-brand-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* URL Input Group Styles */
.url-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.url-input-group::before {
    content: '🌐';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.6;
    z-index: 2;
    pointer-events: none;
}

.url-input-group input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem !important;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--gray-800);
}

.url-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--white);
    transform: translateY(-1px);
}

.url-input-group input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* Dual color picker */
.dual-color-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Enhanced iframe styling - NO SCROLLBARS */
.form-integration-section iframe {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden !important;
    border: none;
}

.embedded-form {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* Ensure no scrollbars appear anywhere in iframes */
iframe {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

iframe::-webkit-scrollbar { 
    display: none; /* WebKit */
}

@media (max-width: 768px) {
    .dual-color-wrapper {
        grid-template-columns: 1fr;
    }
    
    .url-input-group input {
        font-size: 0.9rem;
        padding-left: 2.5rem !important;
    }
    
    .url-input-group::before {
        left: 0.75rem;
        font-size: 0.9rem;
    }
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Dotted Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--gray-200) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 1px;
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.form-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.01em;
}

/* Email Notification Field */
.email-notification {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.email-notification::before {
    content: '📧';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0.6;
}

.email-notification label {
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.email-notification input {
    border: 2px solid rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.8);
}

.email-notification input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.field-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    font-style: italic;
}

/* Form Group Sections */
.form-group-section {
    margin-bottom: 3rem;
}

.form-group-section:last-child {
    margin-bottom: 2rem;
}

.form-group-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* Radio Group */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: block;
    padding: 1.5rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.radio-option label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-option input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.radio-option input[type="radio"]:checked + label::before {
    opacity: 0.05;
}

.radio-content {
    position: relative;
    z-index: 1;
}

.radio-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.radio-desc {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--white);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

/* Color Input Wrapper */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.color-input-wrapper input[type="color"] {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.color-label {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Buttons */
.btn-primary,
.btn-outline {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background-color: #de0500;
    color: #ffffff !important;
    border-width: 0px !important;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600 !important;
    box-shadow: var(--shadow-lg);
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background-color: #b91c1c;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: #de0500 !important;
    border-width: 1px !important;
    border-color: #de0500;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600 !important;
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: #b91c1c;
    color: #b91c1c !important;
    transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--gray-600);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Progress Bar Styles */
.progress-container {
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
}

.progress-wrapper {
    background: var(--gray-200);
    border-radius: 12px;
    height: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary);
}

.progress-status {
    font-style: italic;
}

/* Progress Steps */
.progress-steps {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border-left: 4px solid var(--gray-300);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.progress-step.active {
    background: rgba(59, 130, 246, 0.05);
    border-left-color: var(--primary);
    opacity: 1;
    transform: translateX(8px);
}

.progress-step.completed {
    background: rgba(16, 185, 129, 0.05);
    border-left-color: var(--success);
    opacity: 0.8;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background: var(--primary);
    animation: pulse 2s infinite;
}

.progress-step.completed .step-icon {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.step-text {
    font-weight: 500;
    color: var(--gray-700);
}

.progress-step.active .step-text {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed .step-text {
    color: var(--success);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.success-message h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem 0;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.error-message h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.error-message p {
    color: var(--gray-600);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        margin-bottom: 2rem;
        padding: 2rem 0;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .form-card {
        padding: 2rem;
        border-radius: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn-outline {
        width: 100%;
    }
    
    .email-notification {
        padding: 1.25rem;
    }
    
    .email-notification::before {
        top: 0.75rem;
        right: 0.75rem;
    }

    .progress-container {
        max-width: 100%;
    }

    .progress-text {
        font-size: 0.8rem;
    }

    .progress-steps {
        margin-top: 1.5rem;
    }

    .progress-step {
        padding: 0.5rem 0.75rem;
    }

    .step-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .step-text {
        font-size: 0.9rem;
    }
    
    .v2-badge-centered {
        font-size: 0.8rem;
        padding: 0.4rem 1.2rem;
        margin-bottom: 1rem;
    }
    
    .url-input-group input {
        font-size: 0.9rem;
        padding-left: 2.5rem !important;
    }
    
    .url-input-group::before {
        left: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .header {
        margin-bottom: 1.5rem;
        padding: 1.5rem 0;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-card {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 16px;
    }
    
    .form-group-section {
        margin-bottom: 2rem;
    }
    
    .color-input-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .email-notification {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    body::before {
        background-size: 16px 16px;
    }
}

/* Hover and Focus Animations */
.form-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transitions for interactive elements */
.radio-option label,
.btn-primary,
.btn-outline,
.form-group input,
.form-group select,
.form-group textarea {
    will-change: transform;
}

/* Enhanced focus states */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
}

/* Loading animation enhancement */
.loading {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}