/*
 * base.css — Reset, Design Tokens, Typography, Buttons
 * Signoutshirts Design System
 */

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-bg-soft: #f9fafb;
    --color-bg-muted: #f3f4f6;

    --color-text: #111827;
    --color-text-sub: #4b5563;
    --color-text-faint: #9ca3af;

    --color-border: #e5e7eb;
    --color-border-dark: #d1d5db;

    --color-ink: #000000;
    --color-ink-hover: #1f2937;

    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-danger: #dc2626;
    --color-warn-bg: #fef3c7;
    --color-warn-text: #92400e;

    /* Typography */
    --font-head: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;

    /* Radii */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-full: 9999px;

    /* Shadows */
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --sh-md: 0 4px 6px -1px rgba(0, 0, 0, .05), 0 2px 4px -1px rgba(0, 0, 0, .03);
    --sh-lg: 0 10px 15px -3px rgba(0, 0, 0, .04), 0 4px 6px -2px rgba(0, 0, 0, .02);

    /* Transitions */
    --t-fast: .15s cubic-bezier(.4, 0, .2, 1);
    --t-normal: .25s cubic-bezier(.4, 0, .2, 1);

    /* Layout */
    --max-w: 1120px;
}

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

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

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--t-fast);
}

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

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

ul,
ol {
    list-style: none;
}

/* ==========================================================================
   Typography Scale
   ========================================================================== */
.t-xl {
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -.03em;
    line-height: 1.1;
}

.t-lg {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    letter-spacing: -.02em;
    line-height: 1.2;
}

.t-md {
    font-size: 1.25rem;
    letter-spacing: -.01em;
}

.t-sm {
    font-size: 0.9375rem;
}

.t-xs {
    font-size: 0.875rem;
}

.t-2xs {
    font-size: 0.8125rem;
}

.text-sub {
    color: var(--color-text-sub);
}

.text-faint {
    color: var(--color-text-faint);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.font-semi {
    font-weight: 600;
}

.font-med {
    font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: .75rem 1.75rem;
    font-weight: 500;
    font-size: .9375rem;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--t-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-ink);
    color: #fff;
}

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

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-soft);
    border-color: var(--color-border-dark);
}

.hero__see-designs {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
}

.hero__see-designs:hover {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
    transform: none;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: #047857;
}

.btn-success:disabled {
    background: var(--color-text-faint);
    cursor: not-allowed;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
}

.btn-sm {
    padding: .5rem 1.25rem;
    font-size: .875rem;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: var(--sp-2);
}

.gap-4 {
    gap: var(--sp-4);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Dark Mode Override
   ========================================================================== */
body.dark {
    --color-bg: #010101;
    /* pitch black instead of deep blue */
    --color-bg-soft: #222222;
    /* dark grey alternate */
    --color-bg-muted: #333333;

    --color-text: #ffffff;
    --color-text-sub: #cbd5e1;
    --color-text-faint: #777777;

    --color-border: #333333;
    --color-border-dark: #444444;

    --color-ink: #ffffff;
    --color-ink-hover: #f1f5f9;
}

body.dark input,
body.dark select,
body.dark textarea {
    background-color: var(--color-bg-soft);
    color: var(--color-text);
    border-color: var(--color-border);
}

body.dark input::placeholder {
    color: var(--color-text-faint);
}

body.dark .site-header {
    background: rgba(1, 1, 1, 0.85);
    border-bottom: 1px solid var(--color-border);
}

body.dark .shirt-card,
body.dark .gallery-card,
body.dark .auth-card,
body.dark .analytics-card,
body.dark .admin-panel,
body.dark .admin-order-row,
body.dark .order-status-card {
    background-color: var(--color-bg-soft);
    border-color: var(--color-border);
}

/* Primary buttons, place order CTAs, and design tags are white/light-padded in dark mode.
   Their text must be black to stay readable. */
body.dark .btn-primary,
body.dark .nav__cta,
body.dark .nav__cart-count,
body.dark .filter-pill,
body.dark .form-checkbox,
body.dark .design-tag {
    color: #000000 !important;
}

body.dark .filter-pill:not(.active) {
    color: #ffffff !important;
}

body.dark .btn-secondary {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text);
}

body.dark .hero__see-designs {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text);
}

body.dark .hero__see-designs:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text);
    transform: none;
}

body.dark .btn-secondary:hover {
    background: var(--color-bg-soft);
}

body.dark .nav__links.open {
    background: var(--color-bg);
}

/* Ensure text on green backgrounds (receipt, discount) stays black/dark in dark mode */
body.dark .file-preview,
body.dark .file-preview__name {
    color: #000000 !important;
}

body.dark .file-preview__size {
    color: #374151 !important;
}

body.dark .discount-banner {
    color: #000000 !important;
}

body.dark .checkbox-row input[type="checkbox"]:checked::after {
    border-color: #000000;
}
