/* ===============================
   DesignSport – Dark UI (global)
   =============================== */

/* ---- CSS Reset bits that fix mobile overflow ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* Inputs should never exceed their parent; Safari grid/tables can overflow without this */
input, select, textarea { display: block; width: 100%; max-width: 100%; }
.row > *, .section > *, td > *, th > * { min-width: 0; }

/* ---- Theme tokens ---- */
:root{
  --bg:#0a0a0a;
  --card:#0f0f0f;
  --ink:#eaeaea;
  --ink-dim:#b9b9b9;
  --stroke:#222;
  --accent:#9a4dff;
  --muted:#171717;
  --radius:14px;
}

/* ---- Base page frame ---- */
body{
  font-family: Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 40px;
}

.container{
  max-width: 680px;          /* pages can override this if needed */
  margin: 0 auto;
  padding: 18px;
  background: transparent;   /* the cards provide the surfaces */
}

/* Mobile spacing */
@media (max-width: 640px){
  body{ padding: 18px; }
  .container{ padding: 12px; }
}

/* ---- Headings / text ---- */
h1{
  margin: 0 0 .75rem;
  font-size: 1.45rem;
  letter-spacing: .2px;
}
label{
  display: block;
  font-size: .95rem;
  color: var(--ink);
  margin: .25rem 0 .35rem;
}
.hint{
  font-size: .9rem;
  color: var(--ink-dim);
  margin: .25rem 0 1rem;
}

/* ---------------------------------------
   FORM CONTROLS — uniform across pages
   (covers inputs that omit type="text")
   --------------------------------------- */
input:not([type="file"]):not([type="color"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea{
  background:#0e0e0e;
  color:var(--ink);
  border:1px solid var(--stroke);
  border-radius:10px;
  padding:.8rem .9rem;
  outline:none;
  line-height:1.2;
  font:inherit;
}

input:not([type="file"]):not([type="color"]):not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus{
  border-color:#333;
  box-shadow:0 0 0 3px rgba(154,77,255,.15);
}

/* Textarea tweaks */
textarea{ min-height:130px; resize:vertical; }

/* iOS/Safari autofill color fix */
input:-webkit-autofill,
select:-webkit-autofill,
textarea:-webkit-autofill{
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #0e0e0e inset;
  border:1px solid #333;
}

/* ---- Sections / cards ---- */
.section{
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}
.section-header{
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.section-title{ font-weight: 600; letter-spacing: .2px; }

/* ---- File input wrapper (keeps native control for mobile) ---- */
.file{
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  background: #0e0e0e;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: .6rem;
}
.file input[type="file"]{
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: none;
  padding: .45rem .65rem;
  border-radius: 10px;
}
.file small{ color: var(--ink-dim); }

/* ---- Toggle switch for saved logo toggles ---- */
.toggle{ display:inline-flex; align-items:center; gap:.6rem; cursor:pointer; user-select:none; }
.toggle input{ display:none; }
.switch{
  width:42px; height:24px; background:#1b1b1b; border:1px solid var(--stroke);
  border-radius:999px; position:relative; transition:.2s ease;
}
.switch::after{
  content:""; width:18px; height:18px; border-radius:50%;
  background:#fff; position:absolute; top:2px; left:2px; transition:.2s ease;
}
.toggle input:checked + .switch{ background:#2a2236; border-color:#3a3149; }
.toggle input:checked + .switch::after{ transform: translateX(18px); }

/* ---- Select (kept for clarity; base rule already styles it) ---- */
select{
  background:#0e0e0e;
  color:var(--ink);
  border:1px solid var(--stroke);
  border-radius:10px;
  padding:.7rem .9rem;
}

/* ---- 2-column helper grid ---- */
.row{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
@media (max-width: 640px){ .row{ grid-template-columns:1fr; } }
.is-disabled{ opacity:.6; pointer-events:none; }

/* ---- Divider label ---- */
.divider{ position:relative; text-align:center; margin:1.2rem 0 .6rem; }
.divider span{
  background: var(--bg);
  padding: .1rem .6rem;
  color: var(--ink-dim);
  font-size: .85rem;
  position: relative;
  z-index: 1;
}
.divider::before{
  content:"";
  position:absolute; left:0; right:0; top:50%;
  height:1px; background: var(--stroke);
  transform: translateY(-50%);
  z-index: 0;
}

/* ---- Preview card & image ---- */
.preview-wrap{ margin-top:1.25rem; }
.preview-card{
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 1rem;
}
.img-fit{ width: 100%; height: auto; border-radius: 8px; }

/* ---- Cropper tweaks (desktop-friendly) ---- */
@media (pointer: fine){
  .cropper-view-box{
    opacity:1 !important;
    border:2px solid rgba(255,255,255,0.95) !important;
    box-shadow:none !important;
  }
  .cropper-dashed{ opacity:.25 !important; }
}
.cropper-point{
  width:16px; height:16px;
  background:#fff;
  border:2px solid #111;
  border-radius:50%;
  opacity:1;
}

/* NOTE: Do NOT style the generic <button> here; your pages use .btn classes */

/* ======================================================
   HOME (Generators) — image thumbnails (namespaced)
   ====================================================== */
/* Always 2 columns for the generator gallery */
.home-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}

/* Card with only a thumbnail; no description text */
.home-card{
  padding:0;
  overflow:hidden;
  border-radius:var(--radius);
  border:0px solid var(--stroke);
  background:var(--muted);
}
.home-card a{ display:block; color:inherit; text-decoration:none; }

/* ---- Home thumbnails (show full 1080x1440) ---- */
.home-thumb{
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;              /* 1080x1440 rectangle */
}
.home-thumb img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;               /* show full graphic, no cropping */
  background: #0a0a0a;               /* letterboxing color, blends with theme */
}

/* Title chip overlay */
.home-title{
  position:absolute;
  left:10px;
  bottom:10px;
  font-weight:800;
  font-size:.95rem;
  line-height:1;
  padding:.4rem .6rem;
  border-radius:10px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.08);
  backdrop-filter:saturate(120%) blur(2px);
}
@media (min-width: 720px){
  .home-title{ font-size:1rem; }
}
