/* ================================================
   PodView Design System
   ================================================
   Note: Color and spacing tokens are now loaded from tokens.css
   (generated via: python manage.py generate_tokens)

   This file contains component styles that reference the tokens.
   ================================================ */

/* =========================
   Legacy Variable Aliases
   ========================= */
/* These aliases maintain backward compatibility with existing templates
   that reference the old variable names. New code should use --pw-brand-* */
:root {
    /* Legacy color aliases (reference new token names) */
    --pw-coral: var(--pw-brand-primary);
    --pw-coral-light: var(--pw-brand-primary-light);
    --pw-coral-dark: var(--pw-brand-primary-dark);
    --pw-orange: var(--pw-brand-secondary);

    /* Legacy effect aliases */
    --pw-glow-coral: var(--pw-shadow-glow);
    --pw-glow-coral-sm: var(--pw-shadow-glow-sm);

    /* Legacy spacing alias */
    --pw-gutter: var(--pw-space-lg);
}

/* =========================
   Base Resets for Marketing Pages
   ========================= */
.marketing-page {
    font-family: var(--pw-font-body);
    background-color: var(--pw-bg);
    color: var(--pw-text);
}

.marketing-page h1,
.marketing-page h2,
.marketing-page h3,
.marketing-page h4,
.marketing-page h5,
.marketing-page h6 {
    font-family: var(--pw-font-display);
    letter-spacing: -0.03em;
}

/* =========================
   Form Elements
   =========================
   THE canonical control (#328). Three styles used to coexist: this class (19 call sites,
   set from Python widget attrs), and two near-identical hand-written Tailwind strings that
   differed only in background token — `bg-pw-active` (5 templates) and `bg-pw-hover`
   (6 templates + every `forms.py` literal), of which tags/seasons/danger also dropped the
   radius. The same string lived in Python AND in HTML.

   Aligned to the dominant look — `bg-pw-hover`, `px-4 py-3` — so the majority of surfaces
   do not move; only the widget-rendered fields shift slightly. Padding and background live
   HERE now, which is the whole point: change the control once, every form follows.
   `.form-checkbox` is not defined: a native checkbox is styled with `accent-pw-accent`
   (see docs/BRAND_GUIDELINES.md) — see project note on @tailwindcss/forms being absent. */
.form-input,
.form-textarea,
.form-select {
    display: block;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--pw-border);
    background-color: var(--pw-hover);
    color: var(--pw-text);
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Vertical-only. The corpus typed `resize-y` per widget and the sweep lost it in two
   places, leaving textareas that drag sideways out of their column. A textarea that wants
   no resize says `resize-none`; Tailwind loads after this file and wins on source order. */
.form-textarea {
    resize: vertical;
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* An invalid control must not rely on the error text alone: colour is not the only
   channel, but it is the one a sighted user reads first, and it was missing entirely. */
.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"],
.form-select[aria-invalid="true"] {
    border-color: var(--pw-error);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--pw-accent);
    box-shadow: 0 0 0 3px var(--pw-accent-muted);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--pw-text-disabled);
}

/* The one file input. `Choose File` is a BUTTON the browser draws for us, and twelve
   inputs described it twelve ways: three radii (lg / md / none), a `bg-pw-accent`
   primary, and a `hover:file:bg-white/20` that is all but invisible on the light theme.
   The picker button now wears the secondary button's shape, so it cannot drift from it.
   Named here rather than as a `file:` utility soup because a control names itself
   (see apps/forms_styles.py). */
.form-file {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    contain: inline-size;
    box-sizing: border-box;
    font-size: 0.875rem;
    color: var(--pw-text-subtle);
}

.form-file::file-selector-button {
    margin-right: 1rem;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--pw-text);
    background-color: var(--pw-hover);
    transition: background-color 0.15s ease;
}

.form-file::file-selector-button:hover {
    background-color: var(--pw-active);
}

.form-file:disabled::file-selector-button {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Dark form inputs for marketing pages */
.form-input-dark {
    background-color: var(--pw-hover);
    border: 1px solid var(--pw-border);
    color: var(--pw-text);
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.form-input-dark::placeholder {
    color: var(--pw-text-disabled);
}

.form-input-dark:focus {
    outline: none;
    border-color: var(--pw-accent);
    box-shadow: 0 0 0 3px var(--pw-accent-muted);
}

/* =========================
   Text Utilities
   ========================= */
.text-gradient-coral {
    background: var(--pw-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand gradient highlight word. `color` is a safety net so the word stays
   visible if the gradient fails to paint (print, forced-colors mode, session
   replay tools that don't resolve CSS custom properties, or FOUC before
   tokens.css lands). var() fallback keeps the literal gradient usable even
   when --pw-gradient isn't inherited. */
.text-gradient {
    color: #E85D4C;
    background: var(--pw-gradient, linear-gradient(135deg, #E85D4C 0%, #D4915C 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media print {
    .text-gradient {
        background: none;
        -webkit-text-fill-color: currentColor;
    }
}

@media (forced-colors: active) {
    .text-gradient {
        background: none;
        -webkit-text-fill-color: currentColor;
    }
}

/* Line clamp for truncating text */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================
   Background Effects
   ========================= */
/* Grid pattern removed - Storyteller aesthetic uses clean surfaces */

.bg-glow-coral {
    position: relative;
}

.bg-glow-coral::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--pw-accent-muted) 0%, transparent 70%);
    pointer-events: none;
}

/* Warm ambient glow for hero sections */
.bg-warm-ambient {
    position: relative;
}

.bg-warm-ambient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10%;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(232, 93, 76, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.bg-warm-ambient::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10%;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(212, 145, 92, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* =========================
   Animations
   ========================= */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 77, 77, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 77, 77, 0.5); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* =========================
   Feature Line (step indicators)
   ========================= */
.feature-line {
    position: relative;
}

.feature-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--pw-coral) 0%, transparent 100%);
}

/* =========================
   Scrollbar Utilities
   ========================= */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
