/* ==========================================================================
   formAIt – Main stylesheet
   ========================================================================== */

/* ---------- CSS Reset --------------------------------------------------- */

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

/* ---------- Theme Tokens ------------------------------------------------ */

:root {
    --c-bg: #f9f9fb;
    --c-surface: #ffffff;
    --c-text: #202124;
    --c-muted: #4a4a4d;
    --c-divider: #e4e4e7;

    --c-brand: #2563eb;
    --c-brand-dark: #1e4ec6;
    --c-brand-grad-1: #ff80b5;
    --c-brand-grad-2: #9089fc;
}

[data-theme="dark"] {
    --c-bg: #18181b;
    --c-surface: #27272a;
    --c-text: #f3f4f6;
    --c-muted: #9ca3af;
    --c-divider: #3f3f46;

    --c-brand: #3b82f6;
    --c-brand-dark: #2563eb;
    --c-brand-grad-1: #f472b6;
    --c-brand-grad-2: #818cf8;
}

/* ---------- Base Elements ---------------------------------------------- */

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background: var(--c-bg);
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background 0.25s, color 0.25s;
}

a {
    color: var(--c-brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

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

/* ---------- Layout Helpers --------------------------------------------- */

header {
    background: var(--c-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: background 0.25s;
}

.container {
    width: min(1120px, 90%);
    margin-inline: auto;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

nav .logo {
    font-weight: 700;
    font-size: 1.25rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav li {
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* ---------- DARK-MODE TOGGLE (slider only) ------------------------------ */

.theme-toggle {
    width: 40px;
    height: 24px;
    border-radius: 12px;
    background: var(--c-divider);
    position: relative;
    transition: background 0.25s;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--c-surface);
    transition: transform 0.25s;
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(16px);
}

/* ---------- NEW: Icon wrapper & icons ---------------------------------- */

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.icon-sun,
.icon-moon {
    font-size: 1rem;
    line-height: 1;
    color: var(--c-brand);
    pointer-events: none;
    transition: opacity 0.25s;
}

.icon-sun { opacity: 1; }
.icon-moon { opacity: 0.3; }

[data-theme="dark"] .icon-sun { opacity: 0.3; }
[data-theme="dark"] .icon-moon { opacity: 1; }

/* ---------- Hamburger -------------------------------------------------- */

#menu-toggle { display: none; }

.hamburger {
    display: none;
    position: relative;
    width: 32px;
    height: 28px;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3.5px;
    background: var(--c-text);
    border-radius: 3.5px;
    transition: transform 0.4s ease, opacity 0.4s ease, background 0.3s;
}

.hamburger span:nth-child(1) { top: 4px; }
.hamburger span:nth-child(2) { top: 12px; }
.hamburger span:nth-child(3) { top: 20px; }

/* -- X icon when open -- */
#menu-toggle:checked + .hamburger span:nth-child(1) {
    top: 12px;
    transform: rotate(45deg);
}
#menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0; transform: scale(0.5);
}
#menu-toggle:checked + .hamburger span:nth-child(3) {
    top: 12px;
    transform: rotate(-45deg);
}

.hamburger:hover span { background: var(--c-brand); }

/* ---------- Mobile Dropdown -------------------------------------------- */

@media (max-width: 720px) {
    nav ul {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: saturate(180%) blur(12px);
        padding: 1.2rem 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
        border-bottom: 1px solid var(--c-divider);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity .35s ease, transform .35s ease;
        z-index: 9999;
    }

    [data-theme="dark"] nav ul { background: rgba(39, 39, 42, 0.9); }

    #menu-toggle:checked + .hamburger + ul {
        opacity: 1; pointer-events: auto; transform: translateY(0);
    }

    nav ul li {
        padding: 0.9rem 1.5rem;
        justify-content: center;
    }

    .hamburger { display: block; }
}

/* ---------- Hero ------------------------------------------------------- */

.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 760px;
    margin: 0 auto 2.5rem;
    color: var(--c-muted);
}

.download-btn {
    display: inline-block;
    background: var(--c-brand);
    color: #fff;
    padding: 0.9rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.download-btn:hover { background: var(--c-brand-dark); }

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
}

.hero::before {
    width: 580px;  height: 580px;
    background: var(--c-brand-grad-1);
    top: -160px; left: -180px;
}

.hero::after {
    width: 460px; height: 460px;
    background: var(--c-brand-grad-2);
    bottom: -140px; right: -130px;
}

/* ---------- Features --------------------------------------------------- */

.features {
    padding: 2.5rem 0 ;
    background: var(--c-bg);
    border-top: 1px solid var(--c-divider);
    transition: background 0.25s;
}

.features-grid {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 720px) {
    .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
    background: var(--c-surface);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 2rem 1.75rem;
    transition: background 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--c-muted);
}

.icon-circle {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: grid;
    place-content: center;
    margin-bottom: 1.1rem;
    background: linear-gradient(135deg, var(--c-brand), #3b82f6);
    color: #fff;
    font-size: 1.35rem;
}

/* ---------- Demo section (tabbed) -------------------------------------- */
.demo {                      /* keep existing padding & colours */
  padding: 2.5rem 0;
  border-top: 1px solid var(--c-divider);
  background: var(--c-surface);
}

/* Tabs bar ------------------------------------------------------------- */
.demo-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.8rem auto 2rem;
  flex-wrap: wrap;
}

.demo-tab {
  border: 1px solid transparent;
  background: none;
  color: var(--c-text);
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.demo-tab:hover {
  background: var(--c-surface-hover, rgba(0,0,0,0.04));
}

.demo-tab.is-active {
  border-color: var(--c-brand);
  background: var(--c-surface-hover, rgba(0,0,0,0.04));
  color: var(--c-brand-text, var(--c-brand));
}

/* Panels --------------------------------------------------------------- */
.demo-panels {
  max-width: 920px;
  margin: 0 auto;
}

.demo-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.demo-panel.is-hidden { display: none; }

/* Existing wrapper keeps 16:9 ratio + styles */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;         /* 16:9 */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}



/* ---------- Downloads -------------------------------------------------- */

.downloads {
    padding: 2.5rem 0 5rem;
    background: var(--c-bg);
    border-top: 1px solid var(--c-divider);
    transition: background 0.25s;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.4rem;
}

.dl-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dl-card {
    border: 1px solid var(--c-divider);
    border-radius: 8px;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: var(--c-surface);
    transition: background 0.25s, border 0.25s;
}

.dl-card h4 {
    font-size: 1.15rem;
    font-weight: 600;
}

.dl-card .dl-btn {
    margin-top: auto;
    padding: 0.65rem 1.4rem;
    background: var(--c-brand);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
    display: inline-block;
}

.dl-card .dl-btn:hover { background: var(--c-brand-dark); }

.checksum {
    font-size: 0.8rem;
    word-break: break-all;
    font-family: monospace;
    background: var(--c-surface);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
}

.copy-btn {
    font-size: 0.8rem;
    color: var(--c-brand);
}

/* ---------- Licence section ------------------------------------------- */
.license-section {
  padding: 2.5rem 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-divider);
}

.lic-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.lic-card {
  border: 1px solid var(--c-divider);
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--c-bg);
  transition: background 0.25s, border 0.25s;
  text-align: center;
}

.lic-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.lic-card p {
  font-size: 0.95rem;
  color: var(--c-muted);
}

/* ----- NEW: form & input styling ----- */
.lic-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.lic-input {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--c-divider);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--c-surface);
  color: var(--c-text);
  transition: border 0.2s;
}

.lic-input:focus {
  outline: none;
  border-color: var(--c-brand);
}

/* keep the existing dl‑btn look for the Generate button */
.lic-card .dl-btn {
  margin-top: 0;
  padding: 0.65rem 1.4rem;
  background: var(--c-brand);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
  display: inline-block;
}

.lic-card .dl-btn:hover { background: var(--c-brand-dark); }

.lic-status {
  font-size: 0.9rem;
  color: var(--c-brand);
  margin-top: 0.5rem;
}

/* screen‑reader–only helper */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}


/* ---------- Contact / Footer ------------------------------------------ */

.contact {
    padding: 2.5rem 0;
    border-top: 1px solid var(--c-divider);
    background: var(--c-bg);
    text-align: center;
}

.contact h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.contact p {
    font-size: 1rem;
    color: var(--c-muted);
}

footer {
    margin-top: auto;
    background: var(--c-bg);
    border-top: 1px solid var(--c-divider);
    transition: background 0.25s;
}

.footer-inner {
    padding: 1.6rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--c-muted);
}

/* ---------- Beta / Nightly dropdown ---------- */
.beta-toggle {
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--accent-color, #0077ff);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
}

.beta-toggle .chevron {
  transition: transform 0.3s ease;
}

.beta-toggle.open .chevron {
  transform: rotate(180deg);
}

.beta-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  margin-top: 0.5rem;
}

/* Re‑use existing nightly text styling */
.nightly-note {
  margin: 0;
}


.nightly-note small {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
}

.nightly-note a.unstable-link {
  color: var(--accent-color, #0077ff);
  text-decoration: underline;
}

.nightly-note a.unstable-link:hover {
  text-decoration: none;
}


/* ---------- Dynamic file size ---------- */
.filesize-error {
  color: var(--danger-color, #c00);
}


/* ---------- Open‑Source banner (compact) ------------------------------ */
.oss-banner {
  padding: 2.25rem 0 2.75rem;          /* ↓ was 3.5 / 2.5rem */
  background: var(--c-surface);
  border-top: 1px solid var(--c-divider);
  text-align: center;
}

.oss-banner .heart { color: #e63946; }

/* more compact grid & font sizing */
.oss-grid {
  display: grid;
  gap: 1.4rem 1.6rem;                  /* ↓ was 1.8 / 2rem */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 1.4rem;                  /* ↓ was 1.8rem */
}

.oss-group h4 {
  font-size: 0.9rem;                   /* ↓ was 0.95rem */
  font-weight: 600;
  margin-bottom: 0.45rem;              /* ↓ was 0.6rem */
  color: var(--c-text);
}

.oss-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;                 /* ↓ was 0.55 / 0.75 */
  justify-content: center;
}

.oss-list a {
  color: var(--c-brand);
  font-size: 0.8rem;                   /* ↓ was 0.85rem */
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}

.oss-list a:hover { border-color: var(--c-brand); }

