/*
 * NFC TAP LLC: shared styles for index.html, web.html and invoicemaker.html.
 * Each page sets its colour tokens on :root in its own <head>.
 */

:root {
    --bg: #050b14;
    --nav-bg: rgba(5, 11, 20, 0.5);
    --nav-bg-scrolled: rgba(5, 11, 20, 0.9);
    --grad-a: #4ade80;
    --grad-b: #2dd4bf;
    --grad-c: #3b82f6;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.3);
    --accent-glow: rgba(45, 212, 191, 0.1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: #e2e8f0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Navigation */
.glass-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-nav.is-scrolled {
    background: var(--nav-bg-scrolled);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Cards */
.glass-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: translate 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Blur is expensive on phones, so only enable it on larger screens */
@media (min-width: 768px) {
    .glass-card {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* Hover lift only where a real pointer exists, so taps don't stick */
@media (hover: hover) and (pointer: fine) {
    .glass-card:hover {
        translate: 0 -5px;
        border-color: var(--accent-soft);
        box-shadow: 0 0 30px var(--accent-glow);
    }
}

.border-gradient {
    position: relative;
    isolation: isolate;
    border-radius: 0.5rem;
}

.border-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 0.5rem;
    padding: 1px;
    background: linear-gradient(to right, var(--grad-b), var(--grad-c));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.text-gradient {
    background: linear-gradient(to right, var(--grad-a), var(--grad-b), var(--grad-c));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scroll reveal is animated by assets/app.js (Motion). Hidden until then, only when JavaScript runs. */
.js .reveal {
    opacity: 0;
}

/* Horizontal swipe rows without visible scrollbars */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

/* Cross-site switcher (Home / Web / Invoicing) */
.site-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-switch a {
    padding: 0.4rem 0.85rem;
    border: 1px solid #334155;
    border-radius: 9999px;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.site-switch a:hover {
    color: #fff;
    border-color: #64748b;
}

.site-switch a[aria-current="page"] {
    color: var(--accent);
    border-color: var(--accent-soft);
    background: var(--accent-glow);
}

/* Forms */
.label {
    display: block;
    margin-bottom: 0.375rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field {
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field::placeholder {
    color: #64748b;
}

.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* Round icon button with a 40px+ touch target */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border-radius: 9999px;
    background: #1e293b;
    color: #94a3b8;
    transition: color 0.2s, background-color 0.2s;
}

.safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Phones: stop iOS from zooming into inputs (needs 16px text) */
@media (max-width: 767.98px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
