:root{
  --bg: #0a0a0a;
  --panel: #141414;
  --text: #e0e0e0;
  --muted: #6b6b6b;
  --accent: #7aa2f7;
  --accent-2: #34d399;
  --border: #222222;
}

html { -webkit-text-size-adjust: 100%; }

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
  padding-bottom: 900px; /* add breathing room at the bottom */
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.container{
  max-width: 980px;
  margin: 24px auto;
  padding: 0 8px 48px;
}

/* Site footer: small, subtle, within the centered container */
#site-footer {
  margin: 20px 0 20px;
  padding-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
#site-footer a {
  color: inherit;         /* match the subtle grey */
  text-decoration: underline;
}

/* Payment modal host (PayPal card flow can be very tall, so constrain it) */
#payment-modal .dropin-host{
  margin: 0px 0 16px;
  min-height: 180px;             /* keeps the modal from "jumping" while buttons load */
  max-height: 72vh;              /* NEW: prevents PayPal card UI from pushing modal off-screen */
  overflow-y: auto;              /* NEW: scroll inside this area if PayPal content is tall */
}

/* NEW: keep the whole payment modal within the viewport */
#payment-modal .modal-dialog{
  max-height: 92vh;
  overflow-y: auto;
}

/* NEW: keep the Cancel button accessible even when PayPal content scrolls */
#payment-modal .modal-actions{
  position: sticky;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}


/* Space under the "You’re buying …" line */
#payment-modal #payment-summary{
  margin: 0 0 8px;
}


/* Credits modal layout */
#credits-modal .credits-grid{
  display: grid;
  grid-template-columns: 1fr;  /* stacked vertically */
  gap: 10px;
  margin: 0 0 12px;
}

/* “OR” separator used in the Credits modal */
#credits-modal .or-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  margin: 8px 0 12px;   /* top 8, bottom 16 → now both sides around OR appear 16px */
}
#credits-modal .or-sep::before,
#credits-modal .or-sep::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
#credits-modal .or-sep span { opacity: .9; }


/* Landscape card: horizontal row with price on the right */
#credits-modal .credits-plan{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  text-align: left;
  background: var(--panel, #0f172a);
  border: 1px solid #696969;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow .2s ease, border-color .2s ease, transform .05s ease;
}

/* Hover/focus state */
#credits-modal .credits-plan:hover,
#credits-modal .credits-plan:focus{
  border-color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
    var(--panel, #0f172a);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 8px 20px rgba(0,0,0,0.45);
}

/* Selected glow (match “glow” style feel) */
#credits-modal .credits-plan.selected{
  border-color: var(--accent, #60a5fa);
  background:
    linear-gradient(180deg, rgba(96,165,250,0.12), rgba(96,165,250,0.04)),
    var(--panel, #0f172a);
  box-shadow:
    0 0 0 2px rgba(96,165,250,.35),
    0 10px 28px rgba(96,165,250,.22);
}

/* Tiny badge for “Most Popular” */
#credits-modal .plan-count{
  font-size: 15px;
  color: var(--text);
  order: 1;
}

#credits-modal .plan-badge{
  font-size: 10px;
  line-height: 1;          /* tight line box so height = chip, not extra text space */
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid #696969;
  color: var(--muted);
  margin: 0 0 0 4px;       /* sits to the right of the count */
  order: 2;

  /* Ensure perfect vertical centering and add a 1px optical nudge */
  align-self: center;
  transform: translateY(1px);
}

#credits-modal .plan-price{
  margin-left: auto;  /* keep price pinned to the right */
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  order: 3;
}

/* Buttons: keep Buy as primary (inherits gradient),
   keep Return grey (we already added #credits-return to the grey list) */
#credits-modal .modal-actions{
  justify-content: flex-start; /* Buy left, Return follows */
  margin-top: 20px;
}



header {
  text-align: left;
  margin-bottom: 20px;
}

header .logo {
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 0 0 -32px;  /* space around the logo */
}

header .subtitle {
  font-size: 1.2rem;
  margin: -8px 0 0 0;
  color: var(--muted);
  font-weight: 400;
}

main{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

/* Add space between stacked panels (user panel + generator panel) */
main + main {
  margin-top: 8px;
}

/* Tighter edges only for the top user panel */
.user-panel{
  padding: 6px 6px;
}

/* User panel layout — default (logged out) aligns controls to the right */
.user-panel .user-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;

  min-height: 26px;
}

/* When logged in, spread left/right sections */
.user-panel.logged-in .user-row {
  justify-content: space-between;
}

.user-left{
  color: var(--muted);
  display: inline-flex;   /* NEW: lay out the balance text + button in a row */
  align-items: center;    /* NEW: vertical center alignment */
  gap: 4px;               /* NEW: spacing between text and button (set to 0 if keep margin-left on the button) */
  white-space: nowrap;    /* keeps them on one line */
}


.user-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.user-right .sep {
  opacity: .6;
}

/* Register link */
/* All auth hyperlinks are blue */
.auth-link {
  color: var(--accent);       /* theme blue */
  text-decoration: none;
  font-weight: 600;
  transition: color .12s ease, opacity .12s ease;
}
.auth-link:hover { text-decoration: underline; }
.auth-link:active { opacity: .9; }
.auth-link:visited { color: var(--accent); }  /* keep blue after visit */


/* Front-page Login & Register links — old dark green */
#login-link.auth-link,
#register-link.auth-link {
  color: #059669;              /* old dark green */
}
#login-link.auth-link:hover,
#register-link.auth-link:hover {
  color: #10b981;              /* lighter on hover */
  text-decoration: underline;
}
#login-link.auth-link:active,
#register-link.auth-link:active,
#login-link.auth-link:visited,
#register-link.auth-link:visited {
  color: #047857;              /* pressed/darker state */
}

/* Logout link — old dark green */
#logout-link.auth-link {
  color: #059669;
}
#logout-link.auth-link:hover {
  color: #10b981;
  text-decoration: underline;
}
#logout-link.auth-link:active,
#logout-link.auth-link:visited {
  color: #047857;
}


/* Inline Top Up button (replaces the old hyperlink) */
#topup-btn.topup-btn{
  background: #059669;         /* same green family used before */
  color: #fff;
  border: none;
  padding: 6px 8px;           /* compact chip-like size */
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  margin-left: 8px;
}
#topup-btn.topup-btn:hover{ filter: brightness(0.95); }
#topup-btn.topup-btn:active{ transform: translateY(1px); }


/* Make only the "Resend" link blue */
#resend-link {
  color: var(--accent);     /* theme blue: #7aa2f7 */
}
#resend-link:hover {
  text-decoration: underline;
}
#resend-link:active {
  opacity: .9;              /* subtle press feedback */
}

/* Forgot password link: blue */
#forgot-link {
  color: var(--accent);
}
#forgot-link:hover {
  text-decoration: underline;
}
#forgot-link:active {
  opacity: .9;
}

/* Login verify: blue resend link */
#resend-link-login {
  color: var(--accent);
}
#resend-link-login:hover { text-decoration: underline; }
#resend-link-login:active { opacity: .9; }


/* Modal (empty pop-up) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid;
  place-items: center;
  z-index: 1000;
}
.modal[hidden] { display: none; }

.modal-dialog {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
  width: min(560px, 92vw);
  min-height: 160px;   /* empty for now */
  padding: 16px;
}

/* Tighter bottom padding for User Info & Confirm Unsubscribe modals */
#user-modal .modal-dialog,
#confirm-unsub-modal .modal-dialog {
  padding-bottom: 16px;   /* ↓ reduce bottom whitespace for these two */
}
/* Add more space between User Info details and its buttons */
#user-modal .modal-actions {
  margin-top: 16px;
}


/* User Info modal — vertical spacing between the info lines */
#user-modal .modal-body {
  display: grid;         /* safe, only for this modal */
  row-gap: 6px;          /* tweak: 2–10px */
}

#confirm-unsub-modal .modal-actions {
  margin-top: 16px;
}

/* Modal title */
.modal-title {
  margin: 0 0 16px 0;
  font-size: 18px;
}

/* Compact form layout inside modal */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Inputs (match textarea look & feel) */
.form-grid input[type="text"],
.form-grid input[type="password"],
.form-grid input[type="email"] {
  width: 100%;
  padding: 8px;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.form-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

/* Policy row: checkbox + text + link */
.policy-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

/* Modal actions */
.modal-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;  /* ← was flex-end */
  gap: 8px;
}

/* Left-align buttons for Register and Login modals only */
#auth-modal .modal-actions,
#login-modal .modal-actions {
  justify-content: flex-start;
}

/* Left-align buttons for the Credits modal (match others) */
#credits-modal .modal-actions {
  justify-content: flex-start;
}

/* Compact dialog for the Credits modal (no extra empty space) */
#credits-modal .modal-dialog {
  min-height: auto;
}


.modal-actions button {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1220;
  border: 0;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .04s ease;
  min-width: 120px;            /* <- ensure equal visual width */
  text-align: center;          /* <- center labels inside */
}
.modal-actions button:active { transform: translateY(1px); }

/* Danger (red) buttons: Unsubscribe + Confirm */
#user-unsubscribe-btn,
#confirm-unsub-yes {
  background: #c62828;   /* red */
  color: #fff;
  border: none;
}
#user-unsubscribe-btn:hover,
#confirm-unsub-yes:hover {
  filter: brightness(0.95);
}


/* Grey out disabled modal buttons */
.modal-actions button:disabled {
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.modal-footnote {
  margin-top: 12px;
  font-size: 14px;
}

/* Secondary buttons (Return/Close) */
#register-cancel,
#login-cancel,
#policy-close,
#credits-return,
#payment-cancel,
#user-return-btn,
#confirm-unsub-no {
  background: #1f2937;
  color: var(--text);
  border: 1px solid var(--border);
}


/* Scrollable policy content */
.policy-content {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  height: 305px;            /* ↓ slightly shorter so overall modal matches register */
  overflow: auto;           /* scroll for long text */
  white-space: pre-wrap;    /* preserve line breaks from text file */
  margin: 0 0 16px 0;       /* ↑ clear gap above the Close button */
}

/* One-line error message slot under the checkbox */
/* Error / success message under the policy row (wraps and can grow) */
.form-error {
  color: #ef4444;            /* red-500 */
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  margin: 0;

  /* ✅ allow wrapping + growth */
  height: auto;              /* remove fixed one-line height */
  min-height: 1.35em;        /* keep a stable “slot” when empty */
  white-space: pre-wrap;     /* wrap + preserve any line breaks */
  overflow: visible;         /* don't clip */
  overflow-wrap: anywhere;   /* break long tokens safely */
  word-break: break-word;
}


/* Success state (same slot, just green) */
.form-error.is-success {
  color: var(--accent-2); /* theme green (#34d399) */
}

/* On small screens, allow the line to wrap (but keep a minimum height) */
@media (max-width: 480px) {
  .form-error {
    white-space: normal;        /* allow wrapping */
    overflow: visible;          /* no clipping */
    text-overflow: clip;        /* no ellipsis */
    height: auto;               /* grow if it wraps */
    min-height: 1.2em;          /* reserve space when empty */
    line-height: 1.3;           /* readable multi-line spacing */
    overflow-wrap: anywhere;    /* break long tokens if needed */
    word-break: break-word;     /* safety for long words */
  }
}

form#gen-form{
  display: grid;
  gap: 10px;
}

label{
  color: var(--muted);
  font-size: 13px;
}

textarea{
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 8px;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

button#generate{
  justify-self: start;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1220;
  border: 0;
  padding: 14px 20px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .04s ease;
}

button#generate:disabled{
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

button#generate:active{ transform: translateY(1px); }


/* Actions row: dropdown + button */
form#gen-form .actions {
  display: flex;
  justify-content: space-between;  /* push items to far edges */
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
  row-gap: 12px;
}

/* Minimal select styling to match the UI */
#aspect {
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.4;

  appearance: none;  /* remove native dropdown styling */
  -webkit-appearance: none;
  -moz-appearance: none;
}

#aspect:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

.ratio-select {
  display: flex;
  align-items: center;
  gap: 6px; /* space between label and dropdown */
}

.ratio-select label {
  color: var(--muted);
  font-size: 14px;
}


.progress-wrap{
  position: relative;
  height: 12px;
  margin: 16px 0 32px 0;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.progress-bar{
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease;
}

#progress-text{
  display: inline-block;
  margin-left: 0;
  font-size: 13px;
  color: var(--muted);
}

.display{
  display: grid;
  place-items: center;
  min-height: 360px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

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

.slideshow {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 14px 0 1px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b1220;
  padding: 6px;
  gap: 6px;
  white-space: normal; /* disable nowrap since flex handles layout */
}

.slideshow img {
  display: block;      /* removes inline gaps */
  border-radius: 10px;  /* optional, for style */
}

.slides{
  display: inline-flex;
  gap: 6px;
}

.slides .thumb{
  height: 72px;
  width: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  opacity: .9;
  transition: transform .15s ease, opacity .15s ease;
}

.slides .thumb:hover{
  transform: translateY(-2px);
  opacity: 1;
}


/* Make the big placeholder inside the display match the muted tone */
#placeholder {
  color: var(--muted);
  font-size: 16px; /* keep it consistent across devices */
}

/* Make the textarea's placeholder match the same muted tone */
textarea::placeholder {
  color: var(--muted);
  opacity: 1;      /* Safari/iOS lowers opacity by default */
}

:root { --control-gap: 6px; }

/* Right-side controls: "Image has human" + ratio select in one row */
form#gen-form .right-controls {
  display: flex;
  align-items: center;
  gap: var(--control-gap, 8px); /* tweak this custom property to change spacing */
}

.human-toggle {
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px; /* keep tight */
  font-size: 14px;   /* match Output Ratio label */
}

.human-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* =============================
   SEO / Marketing Pages (NEW)
   ============================= */

.top-nav {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}

.top-nav a:hover {
  text-decoration: underline;
  opacity: 1;
}

.footer-row {
  margin-bottom: 8px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.85;
}

.footer-nav a:hover {
  text-decoration: underline;
  opacity: 1;
}

.content-page {
  width: 100%;            /* match the container width (like the footer line) */
  max-width: 100%;        /* remove the 920px cap */
  margin: 0;              /* no centering needed now */
  padding: 18px 18px 18px;   /* keep outside padding */
  box-sizing: border-box;
}


.page-title {
  margin: 10px 0 0;
  text-align: center;
  font-size: 28px;
}

.lead {
  margin-top: 10px;
  opacity: 0.95;
  line-height: 1.5;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  padding: 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  line-height: 1.25;
}


/* Hidden SEO block (visible to crawlers, hidden from users) */
#seo-content {
  display: none;
}

