/* ===== Spin Automation - Main Stylesheet ===== */
/* Version: 1.0 - Production Ready */

/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: #111827;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    font-size: 100%;
}

/* ===== Design Tokens ===== */
:root {
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e3a8a;
    --color-secondary: #10b981;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-white: #ffffff;
    --color-green-50: #ecfdf5;
    --color-green-200: #a7f3d0;
    --color-green-800: #065f46;
    --color-red-50: #fef2f2;
    --color-red-200: #fecaca;
    --color-red-800: #991b1b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

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

/* ===== Display ===== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ===== Flexbox ===== */
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

/* ===== Gap & Spacing ===== */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ===== Typography ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.whitespace-nowrap { white-space: nowrap; }

/* ===== Colors ===== */
.text-white { color: var(--color-white); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-primary { color: var(--color-primary); }

.bg-white { background-color: var(--color-white); }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }

/* ===== Borders ===== */
.border { border-width: 1px; border-style: solid; border-color: var(--color-gray-200); }
.border-2 { border-width: 2px; border-style: solid; border-color: var(--color-gray-200); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: var(--color-gray-200); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: var(--color-gray-200); }
.border-gray-300 { border-color: var(--color-gray-300); }

.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ===== Shadows ===== */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ===== Padding ===== */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }

/* ===== Margin ===== */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.-mr-2 { margin-right: -0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ===== Sizing ===== */
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }

.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }

.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-md { max-width: 28rem; }

.aspect-square { aspect-ratio: 1 / 1; }

/* ===== Position ===== */
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.relative { position: relative; }
.absolute { position: absolute; }
.bottom-4 { bottom: 1rem; }
.right-4 { right: 1rem; }

/* ===== Grid ===== */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ===== Responsive - SM (640px+) ===== */
@media (min-width: 640px) {
    .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:bottom-8 { bottom: 2rem; }
    .sm\:right-8 { right: 2rem; }
    .sm\:p-4 { padding: 1rem; }
    .sm\:p-6 { padding: 1.5rem; }
    .sm\:p-8 { padding: 2rem; }
    .sm\:py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .sm\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .sm\:gap-4 { gap: 1rem; }
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:gap-8 { gap: 2rem; }
    .sm\:space-y-8 > * + * { margin-top: 2rem; }
    .sm\:mb-12 { margin-bottom: 3rem; }
    .sm\:mb-16 { margin-bottom: 4rem; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Responsive - MD (768px+) ===== */
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
    .md\:col-span-1 { grid-column: span 1 / span 1; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.15; }
}

/* ===== Responsive - LG (1024px+) ===== */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:gap-12 { gap: 3rem; }
    .lg\:space-x-8 > * + * { margin-left: 2rem; }
    .lg\:text-left { text-align: left; }
    .lg\:justify-start { justify-content: flex-start; }
    .lg\:order-last { order: 9999; }
    .lg\:max-w-none { max-width: none; }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1.1; }
}

/* ===== Component: Gradient Text ===== */
.gradient-text {
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Component: Gradient Backgrounds ===== */
.bg-gradient-hero {
    background: linear-gradient(to bottom, var(--color-gray-50), var(--color-white));
}

.bg-gradient-svg {
    background: linear-gradient(to bottom right, rgba(30, 58, 138, 0.05), rgba(16, 185, 129, 0.05), rgba(30, 58, 138, 0.05));
}

.bg-secondary-10 {
    background-color: rgba(16, 185, 129, 0.1);
}

.bg-primary-10 {
    background-color: rgba(30, 58, 138, 0.1);
}

/* ===== Component: Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: #1e3a8a;
    filter: brightness(0.9);
}

.btn-outline {
    border: 2px solid var(--color-gray-300);
    background-color: transparent;
}

.btn-outline:hover {
    border-color: var(--color-primary);
}

/* ===== Component: Form Inputs ===== */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* ===== Component: Cards ===== */
.card {
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color 0.15s ease;
}

.card:hover {
    border-color: rgba(30, 58, 138, 0.5);
}

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

/* ===== Component: Dots ===== */
.dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: var(--color-secondary);
    flex-shrink: 0;
}

.dot-lg {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background-color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== Component: Floating Stat Card ===== */
.floating-stat {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.75rem;
    border: 2px solid rgba(30, 58, 138, 0.1);
}

@media (min-width: 640px) {
    .floating-stat { padding: 1rem; }
}

@media (max-width: 639px) {
    .floating-stat {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 1rem;
        display: inline-block;
    }
}

/* ===== Component: SVG Container ===== */
.workflow-svg-container {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-2xl);
    padding: 1rem;
    max-width: 28rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .workflow-svg-container { padding: 2rem; }
}

@media (min-width: 1024px) {
    .workflow-svg-container { max-width: none; }
}

@media (max-width: 639px) {
    .workflow-svg-container { max-width: 300px; }
}

/* ===== Component: Mobile Menu ===== */
.mobile-menu {
    background-color: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
}

.mobile-menu a {
    display: block;
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-600);
}

/* ===== Component: Footer ===== */
.footer-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: var(--color-secondary);
}

.border-white-20 {
    border-color: rgba(255, 255, 255, 0.2);
}

.text-white-60 {
    color: rgba(255, 255, 255, 0.6);
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Component: Messages ===== */
.message-success {
    padding: 1rem;
    border-radius: var(--radius-md);
    background-color: var(--color-green-50);
    border: 1px solid var(--color-green-200);
    color: var(--color-green-800);
}

.message-error {
    padding: 1rem;
    border-radius: var(--radius-md);
    background-color: var(--color-red-50);
    border: 1px solid var(--color-red-200);
    color: var(--color-red-800);
}

/* ===== Animations ===== */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes node-pulse {
    0%, 100% { opacity: 0.4; r: 6; }
    50% { opacity: 1; r: 8; }
}

@keyframes connection-flow {
    0% { stroke-dashoffset: 1000; }
    100% { stroke-dashoffset: 0; }
}

.node-pulse { animation: node-pulse 2s ease-in-out infinite; }
.connection-flow { 
    stroke-dasharray: 5 5;
    animation: connection-flow 3s linear infinite; 
}

/* ===== Hover States ===== */
.hover-primary:hover {
    color: var(--color-primary);
}

.transition-colors {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.transition-transform {
    transition: transform 0.7s ease;
}

.group:hover .group-hover-rotate {
    transform: rotate(90deg);
}

.hover-underline:hover {
    text-decoration: underline;
}

/* ===== Section Padding ===== */
.section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (min-width: 640px) {
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 768px) {
    .section-padding {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* ===== Touch-friendly Targets ===== */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
    }
}

/* ===== Hero Layout - Desktop: SVG Left, Text Right ===== */
.hero-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .hero-svg-col {
        order: 0;
    }
    
    .hero-text-col {
        order: 1;
    }
}

/* Mobile: SVG first (top), Text second (bottom) */
@media (max-width: 1023px) {
    .hero-svg-col {
        order: 0;
    }
    
    .hero-text-col {
        order: 1;
    }
}

/* ===== Value Pillars - 2 Left, 2 Right Layout ===== */
.pillars-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}
