/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal overflow globally */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    max-width: 100%;
}

/* CSS Custom Properties (Design System) */
:root {
    --background: hsl(0 0% 100%);
    --foreground: hsl(215 25% 15%);
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(215 25% 15%);
    --popover: hsl(0 0% 100%);
    --popover-foreground: hsl(215 25% 15%);
    --primary: hsl(215 45% 20%);
    --primary-foreground: hsl(0 0% 100%);
    --secondary: hsl(215 20% 95%);
    --secondary-foreground: hsl(215 45% 20%);
    --muted: hsl(215 20% 96%);
    --muted-foreground: hsl(215 15% 45%);
    --accent: hsl(178 65% 42%);
    --accent-foreground: hsl(0 0% 100%);
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(0 0% 100%);
    --border: hsl(215 20% 88%);
    --input: hsl(215 20% 88%);
    --ring: hsl(178 65% 42%);
    --radius: 0.5rem;
    
    /* Custom design tokens */
    --hero-gradient: linear-gradient(135deg, hsl(215 45% 20%) 0%, hsl(215 40% 30%) 100%);
    --form-bg: hsl(215 30% 98%);
    --form-shadow: 0 10px 40px -10px hsl(215 45% 20% / 0.15);
    --accent-light: hsl(178 65% 92%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
.dark {
    --background: hsl(215 30% 8%);
    --foreground: hsl(0 0% 98%);
    --card: hsl(215 30% 10%);
    --card-foreground: hsl(0 0% 98%);
    --popover: hsl(215 30% 10%);
    --popover-foreground: hsl(0 0% 98%);
    --primary: hsl(0 0% 98%);
    --primary-foreground: hsl(215 45% 20%);
    --secondary: hsl(215 25% 15%);
    --secondary-foreground: hsl(0 0% 98%);
    --muted: hsl(215 25% 15%);
    --muted-foreground: hsl(215 15% 60%);
    --accent: hsl(178 65% 42%);
    --accent-foreground: hsl(0 0% 100%);
    --destructive: hsl(0 62.8% 30.6%);
    --destructive-foreground: hsl(0 0% 98%);
    --border: hsl(215 25% 20%);
    --input: hsl(215 25% 20%);
    --ring: hsl(178 65% 42%);
}

/* Base styles */
body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Layout utilities */
.min-h-screen {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Mobile-first responsive container - iPhone optimized */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
        max-width: 100%;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    .container {
        padding: 0 0.75rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Header styles */
.header {
    border-bottom: 1px solid var(--border);
    background-color: hsl(var(--card) / 0.5);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-foreground);
}

.logo-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
}

/* Main content - iPhone optimized spacing */
.main-content {
    padding: 1rem 0;
}

@media (min-width: 481px) {
    .main-content {
        padding: 1.5rem 0;
    }
}

@media (min-width: 768px) {
    .main-content {
        padding: 3rem 0;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 5rem 0;
    }
}

.content-grid {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 481px) {
    .content-grid {
        gap: 2rem;
    }
}

@media (min-width: 768px) {
    .content-grid {
        gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

/* Form section - Better mobile margins */
.form-section {
    order: 1;
}

@media (min-width: 1024px) {
    .form-section {
        order: 2;
        position: sticky;
        top: 2rem;
    }
}

.form-card {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--form-shadow);
    padding: 0.75rem;
    border: 1px solid var(--border);
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 481px) {
    .form-card {
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    .form-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .form-card {
        padding: 2rem;
    }
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.form-divider {
    height: 0.25rem;
    background-color: var(--accent);
    border-radius: 9999px;
}

/* Form styles */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--foreground);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.form-button {
    flex: 1;
    height: 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-button:hover {
    background-color: var(--secondary);
}

.form-button.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-input,
.form-select {
    height: 3rem;
    padding: 0 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

.submit-button {
    width: 100%;
    height: 3.5rem;
    background-color: var(--accent);
    color: var(--accent-foreground);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button:hover {
    background-color: hsl(178 65% 35%);
}

.form-disclaimer {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 1.5rem;
    text-align: center;
}

/* Hero section - Improved mobile spacing */
.hero-section {
    order: 2;
}

@media (min-width: 1024px) {
    .hero-section {
        order: 1;
    }
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fade-in 0.5s ease-out;
}

@media (min-width: 768px) {
    .hero-content {
        gap: 2rem;
    }
}

.hero-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background-color: hsl(var(--accent) / 0.1);
    border-radius: 9999px;
    align-self: flex-start;
}

.badge-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

.hero-title {
    font-size: 1.875rem;
    font-weight: bold;
    line-height: 1.1;
    color: var(--primary);
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

.hero-description {
    font-size: 1rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .hero-description {
        font-size: 1.125rem;
    }
}

@media (min-width: 1024px) {
    .hero-description {
        font-size: 1.25rem;
    }
}

.highlight-text {
    font-weight: 600;
    color: var(--foreground);
}

.hero-image-container {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.hero-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .features-grid {
        gap: 1.5rem;
    }
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    background-color: hsl(var(--secondary) / 0.5);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    background-color: var(--secondary);
}

.feature-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background-color: hsl(var(--accent) / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent);
}

.feature-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
}

.feature-description {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.testimonial {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    padding: 1rem 0 1rem 1.5rem;
    background-color: hsl(var(--accent) / 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.testimonial-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-style: italic;
}

/* Footer - Better mobile spacing */
.footer {
    border-top: 1px solid var(--border);
    background-color: hsl(var(--muted) / 0.3);
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .footer {
        margin-top: 5rem;
    }
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        padding: 2rem 0;
    }
}

.footer-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-text {
        text-align: left;
    }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
}

.toast {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 300px;
    animation: slide-in 0.4s ease-out;
}

@media (max-width: 640px) {
    .toast {
        min-width: auto;
        width: 100%;
    }
}

.toast.success {
    border-left: 4px solid var(--accent);
}

.toast-title {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* iPhone and small mobile improvements */
@media (max-width: 480px) {
    /* Ensure proper touch targets */
    .form-button {
        min-height: 44px;
        font-size: 0.8rem;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .submit-button {
        min-height: 48px;
        font-size: 0.9rem;
    }
    
    /* Better spacing for iPhone */
    .form {
        gap: 1rem;
    }
    
    .form-group {
        gap: 0.5rem;
    }
    
    .form-header {
        margin-bottom: 1rem;
    }
    
    /* Improve readability on iPhone */
    .form-label {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .hero-content {
        gap: 1rem;
    }
    
    .feature-card {
        padding: 0.75rem;
    }
    
    .feature-title {
        font-size: 0.8rem;
    }
    
    .feature-description {
        font-size: 0.7rem;
    }
    
    /* Fix image overflow on iPhone */
    .hero-image-container {
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .hero-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* Ensure no horizontal scroll */
    .hero-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix form row on iPhone */
    .form-row {
        gap: 0.5rem;
    }
    
    /* Ensure all form elements fit */
    .form-input,
    .form-select,
    .form-button {
        width: 100%;
        max-width: 100%;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    /* Ensure proper touch targets */
    .form-button {
        min-height: 44px;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .submit-button {
        min-height: 48px;
    }
    
    /* Better spacing for larger mobile */
    .form {
        gap: 1.25rem;
    }
    
    .form-group {
        gap: 0.5rem;
    }
    
    /* Improve readability on small screens */
    .form-label {
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
}