/* ============================================
   Equdex Design System — Pure CSS
   Replicates React/Tailwind design tokens
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(168, 10%, 10%);

    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(168, 10%, 10%);

    --primary: hsl(168, 76%, 30%);
    --primary-foreground: hsl(0, 0%, 100%);

    --secondary: hsl(168, 20%, 95%);
    --secondary-foreground: hsl(168, 76%, 25%);

    --muted: hsl(168, 10%, 94%);
    --muted-foreground: hsl(168, 10%, 45%);

    --border: hsl(168, 15%, 90%);
    --input: hsl(168, 15%, 90%);
    --ring: hsl(168, 76%, 30%);

    --radius: 0.75rem;

    --gradient-primary: linear-gradient(135deg, hsl(168, 76%, 30%), hsl(168, 84%, 20%));
    --gradient-hero: linear-gradient(180deg, hsl(168, 81%, 96%) 0%, hsl(0, 0%, 100%) 100%);

    --shadow-sm: 0 1px 2px 0 hsla(168, 10%, 10%, 0.03);
    --shadow-md: 0 4px 6px -1px hsla(168, 10%, 10%, 0.05), 0 2px 4px -2px hsla(168, 10%, 10%, 0.03);
    --shadow-lg: 0 10px 15px -3px hsla(168, 10%, 10%, 0.08), 0 4px 6px -4px hsla(168, 10%, 10%, 0.03);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-color: var(--border);
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.min-h-screen {
    min-height: 100vh;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* --- Page Wrapper --- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
}

/* --- Header (legal pages) --- */
.site-header {
    border-bottom: 1px solid var(--border);
    background-color: var(--card);
    padding: 1rem 0;
}

.site-header .header-logo {
    height: 2.5rem;
    width: auto;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    background: var(--gradient-hero);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.hero-decorations {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-blob {
    position: absolute;
    width: 20rem;
    height: 20rem;
    background: hsla(168, 76%, 30%, 0.05);
    border-radius: 50%;
    filter: blur(48px);
}

.hero-blob--top-right {
    top: -10rem;
    right: -10rem;
}

.hero-blob--bottom-left {
    bottom: -10rem;
    left: -10rem;
}

.hero-content {
    position: relative;
    padding: 4rem 0;
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
}

.hero-logo {
    height: 4rem;
    margin: 0 auto;
    filter: drop-shadow(0 10px 8px rgba(0,0,0,0.04)) drop-shadow(0 4px 3px rgba(0,0,0,0.1));
}

.hero-content .animate-fade-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: hsla(168, 76%, 30%, 0.1);
    border: 1px solid hsla(168, 76%, 30%, 0.2);
}

.badge-dot {
    position: relative;
    display: flex;
    height: 0.5rem;
    width: 0.5rem;
}

.badge-dot-ping {
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0.75;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.badge-dot-core {
    position: relative;
    display: inline-flex;
    border-radius: 50%;
    height: 0.5rem;
    width: 0.5rem;
    background-color: var(--primary);
}

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

/* --- Headline --- */
.headline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.headline h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.headline h1 .text-foreground {
    color: var(--foreground);
}

.headline h1 .text-primary {
    color: var(--primary);
}

.headline-subtitle {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 36rem;
    margin: 0 auto;
    line-height: 1.75;
}

/* --- Signup Form --- */
.signup-section {
    max-width: 28rem;
    margin: 0 auto;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

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

.signup-input {
    flex: 1 1 auto;
    width: 100%;
    height: 3.25rem;
    font-size: 1rem;
    padding: 0 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--foreground);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    font-family: inherit;
    box-shadow: var(--shadow-sm), inset 0 1px 2px hsla(168, 10%, 10%, 0.02);
    -webkit-appearance: none;
    appearance: none;
}

.signup-input::placeholder {
    color: var(--muted-foreground);
    opacity: 0.7;
}

.signup-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px hsla(168, 76%, 30%, 0.12), var(--shadow-sm);
    background-color: hsl(0, 0%, 100%);
}

.signup-button {
    height: 3rem;
    padding: 0 2rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--primary-foreground);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.signup-button:hover {
    opacity: 0.9;
}

.signup-button:active {
    transform: scale(0.98);
}

.signup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.signup-disclaimer {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.75rem;
}

/* --- Features Section --- */
.features {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
    background-color: var(--card);
}

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

.feature-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.feature-card:hover {
    background-color: hsla(168, 20%, 95%, 0.5);
}

.feature-icon-box {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    background-color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon-box svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
    stroke: var(--primary);
}

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

.feature-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    background-color: var(--card);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

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

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

.footer-links a {
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--foreground);
}

/* --- Legal Pages (Terms, Privacy) --- */
.legal-content {
    flex: 1;
    padding: 3rem 0;
}

.legal-container {
    max-width: 48rem;
}

.legal-container h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 2rem;
}

.legal-container .last-updated {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.legal-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--muted-foreground);
    line-height: 1.7;
}

.legal-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.legal-section p {
    line-height: 1.7;
}

.legal-section ul {
    list-style: disc;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legal-section ul li {
    line-height: 1.7;
}

.legal-section a {
    color: var(--primary);
    transition: text-decoration 0.2s;
}

.legal-section a:hover {
    text-decoration: underline;
}

.legal-section strong {
    color: var(--foreground);
    font-weight: 600;
}

/* --- Error / 404 Page --- */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--muted);
    text-align: center;
}

.error-code {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.error-link {
    color: var(--primary);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.error-link:hover {
    opacity: 0.9;
}

/* --- Toast Notification --- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-foreground);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 3.7s forwards;
    max-width: 24rem;
}

.toast--success {
    background-color: var(--primary);
}

.toast--error {
    background-color: hsl(0, 84%, 60%);
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

/* --- Responsive Breakpoints --- */

/* Mobile-first: larger touch targets */
@media (max-width: 639px) {
    .signup-input {
        height: 3.5rem;
        font-size: 1.0625rem;
        padding: 0 1.25rem;
        border-radius: var(--radius);
    }

    .signup-button {
        height: 3.5rem;
        font-size: 1.0625rem;
        border-radius: var(--radius);
    }
}

/* sm: 640px */
@media (min-width: 640px) {
    .signup-form-row {
        flex-direction: row;
    }
}

/* md: 768px */
@media (min-width: 768px) {
    .hero-content {
        padding: 6rem 0;
    }

    .hero-logo {
        height: 6rem;
    }

    .headline h1 {
        font-size: 3rem;
    }

    .headline-subtitle {
        font-size: 1.25rem;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* lg: 1024px */
@media (min-width: 1024px) {
    .headline h1 {
        font-size: 3.75rem;
    }
}
