/* ==========================================================================
   Cogni.Codes — shared site styles
   Custom classes used alongside Tailwind utilities (see assets/js/tailwind-config.js
   for the design tokens; docs/DESIGN.md for the design system reference).
   ========================================================================== */

:root {
    /* #2e8c53 is the brand green — used for large headings, icons and accents.
       For normal-size text and white-on-green buttons it does not meet WCAG AA
       (4.21:1), so those use the deeper greens below (6.7:1+). */
    --color-primary: #2e8c53;
    --color-primary-dark: #0b6a39;
    --color-primary-darker: #084e2a;
    --color-secondary: #266b43;
    --color-error: #ba1a1a;
    --color-surface: #f8faf9;
    --color-pattern-dot: #e1e3e2;
}

/* --------------------------------------------------------------------------
   Brand logo (header)
   The source image is high-resolution, so constrain it here rather than
   relying on the intrinsic size. Height is capped to sit inside the 80px
   (h-20) nav bar; width scales with the aspect ratio.
   -------------------------------------------------------------------------- */

.site-logo {
    display: block;
    height: 60px;
    width: auto;
    max-height: 100%;
    max-width: 200px;
    object-fit: contain;
}

@media (max-width: 640px) {
    .site-logo {
        height: 42px;
        max-width: 160px;
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--color-primary-dark);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 0.25rem;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary-darker);
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: transparent;
    border: 1px solid var(--color-primary-dark);
    color: var(--color-primary-dark);
    padding: 11px 23px;
    border-radius: 0.25rem;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(11, 106, 57, 0.08);
    transform: scale(1.02);
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* Generic button micro-interaction (DESIGN.md: 200ms ease-out scale) */
.btn-interactive,
.btn-interaction {
    transition: transform 200ms ease-out, background-color 200ms ease;
}

.btn-interactive:hover,
.btn-interaction:hover {
    transform: scale(1.02);
}

.btn-interactive:active,
.btn-interaction:active {
    transform: scale(0.98);
}

/* --------------------------------------------------------------------------
   Cards — Ambient Tonal Depth (DESIGN.md: Elevation & Depth)
   -------------------------------------------------------------------------- */

.card-elevation,
.service-card {
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-elevation:hover,
.service-card:hover {
    box-shadow: 0px 12px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.card-low-elev {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.card-low-elev:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   Decorative background patterns (hero sections)
   -------------------------------------------------------------------------- */

.bg-pattern,
.pattern-bg {
    background-color: var(--color-surface);
    background-image: radial-gradient(var(--color-pattern-dot) 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-pattern {
    background-image: radial-gradient(var(--color-pattern-dot) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --------------------------------------------------------------------------
   Scroll-in animations
   -------------------------------------------------------------------------- */

/* Progressive enhancement: content is visible by default. The hidden start
   state only applies once JS has added the "js" class to <html> (a11y.js, in
   <head>), and JS then reveals it. So if scripts fail or the observer never
   fires, content is never left invisible. */
.fade-in-up {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

html.js .fade-in-up,
html.js .fade-up {
    opacity: 0;
    transform: translateY(20px);
}

html.js .fade-in-up.visible,
html.js .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.anim-delay-100 { transition-delay: 100ms; }
.anim-delay-200 { transition-delay: 200ms; }
.anim-delay-300 { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
    html.js .fade-in-up,
    html.js .fade-up {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Material Symbols icon variants
   -------------------------------------------------------------------------- */

.icon-filled {
    font-variation-settings: 'FILL' 1;
}

.icon-outlined {
    font-variation-settings: 'FILL' 0;
}

/* --------------------------------------------------------------------------
   Form fields (Contact page)
   -------------------------------------------------------------------------- */

.input-glow:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(46, 140, 83, 0.15);
}

/* Hidden by default; shown by contact.js validation (jQuery slideDown/slideUp) */
.error-message {
    display: none;
    color: var(--color-error);
    font-size: 12px;
    line-height: 16px;
    margin-top: 4px;
}

.is-invalid {
    border-color: var(--color-error) !important;
}

/* AJAX submit result banner (contact.js) */
.form-status {
    border-radius: 0.5rem;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.form-status--success {
    background-color: #eafaf0;
    border: 1px solid var(--color-primary);
    color: #03522d;
}

.form-status--error {
    background-color: #ffdad6;
    border: 1px solid var(--color-error);
    color: #93000a;
}

/* --------------------------------------------------------------------------
   In-page anchor targets
   Offsets scroll landing so anchored content (e.g. /Services#payment-solutions,
   /Contact#contactForm) is not hidden behind the fixed 80px header.
   -------------------------------------------------------------------------- */

.anchor-offset {
    scroll-margin-top: 6rem;
}
