:root {
  --ink: #11174a;
  --muted: #5f6685;

  --blue: #2f80ed;
  --blue-soft: #eef7ff;

  --mint: #1dbfa7;
  --mint-soft: #effcf8;

  --purple: #7068f4;
  --purple-soft: #f3f1ff;

  --coral: #ff5b45;
  --coral-dark: #e84834;

  --yellow: #ffd64d;

  --card-bg: rgba(255, 255, 255, 0.9);
  --border: #d9e2f2;
  --shadow: 0 18px 45px rgba(35, 52, 100, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: url("card_sheet_background.svg") center top / cover no-repeat fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: -1;
}

h1 {
  margin: 28px 0 4px;
  text-align: center;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 3px 0 rgba(255,255,255,0.8);
}

h1::after {
  content: "Create printable card sheets in just a few clicks!";
  display: block;
  margin-top: 14px;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 18px;
  font-size: 26px;
}

h3 {
  margin: 22px 0 6px;
  font-size: 18px;
}

#cardForm,
#previewWrap {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

body > h1,
body > #cardForm,
body > #previewWrap {
  width: min(92vw, 1680px);
  margin-left: auto;
  margin-right: auto;
}

#cardForm {
  margin-top: 34px;
  padding: 30px;
}

#previewWrap {
  margin-top: 28px;
  margin-bottom: 50px;
  padding: 30px;
}

label {
  display: block;
  margin-top: 16px;
  font-weight: 800;
  color: var(--ink);
}

small {
  display: block;
  margin: 4px 0 8px;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.14);
}

input[type="file"] {
  padding: 12px;
  border-style: dashed;
  background: #fbfdff;
}

input[type="file"]::file-selector-button {
  margin-right: 14px;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0 10px 0 0;
  accent-color: var(--blue);
  vertical-align: middle;
}

button {
  width: 100%;
  margin-top: 28px;
  min-height: 68px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff6b4a, var(--coral));
  color: white;
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(255, 91, 69, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button::before {
  content: "📄 ";
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(255, 91, 69, 0.32);
  filter: brightness(1.03);
}

button:active {
  transform: translateY(0);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* Section styling based on your current HTML structure */
#cardForm > label:nth-of-type(1),
#cardForm > label:nth-of-type(2),
#cardForm > .grid:nth-of-type(1),
#cardForm > h3,
#cardForm > small,
#cardForm > .grid:nth-of-type(2),
#cardForm > label:nth-of-type(3),
#cardForm > label:nth-of-type(4) {
  position: relative;
}

#cardForm > label:nth-of-type(1),
#cardForm > label:nth-of-type(2) {
  padding: 18px;
  background: rgba(238, 247, 255, 0.8);
  border-radius: var(--radius-md);
}

#cardForm > .grid:nth-of-type(1) {
  margin-top: 20px;
  padding: 20px;
  background: rgba(238, 247, 255, 0.85);
  border-radius: var(--radius-md);
}

#cardForm > h3,
#cardForm > small,
#cardForm > .grid:nth-of-type(2) {
  background: rgba(239, 252, 248, 0.9);
}

#cardForm > h3 {
  margin-top: 22px;
  padding: 20px 20px 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

#cardForm > small {
  padding: 0 20px;
}

#cardForm > .grid:nth-of-type(2) {
  padding: 0 20px 20px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

#cardForm > label:nth-of-type(3) {
  padding: 18px;
  background: rgba(243, 241, 255, 0.9);
  border-radius: var(--radius-md);
}

#cardForm > label:nth-of-type(4) {
  display: flex;
  align-items: center;
  padding: 18px;
  background: rgba(255, 248, 220, 0.95);
  border-radius: var(--radius-md);
}

/* Preview */
#previewWrap {
  position: relative;
}

#previewWrap h2::before {
  content: "👁️ ";
}

#previewCanvas {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #d7ddea;
  border-radius: 14px;
  box-shadow: 0 16px 35px rgba(17, 23, 74, 0.12);
}

#status {
  margin-top: 18px;
  font-weight: 800;
  color: var(--muted);
}

#status::before {
  content: "✅ ";
}

/* Desktop two-column layout */
@media (min-width: 1100px) {
  body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title title"
      "form preview";
    gap: 22px;
    align-items: start;
    padding: 0 5vw 50px;
  }

  body > h1 {
    grid-area: title;
    width: 100%;
  }

  body > #cardForm {
    grid-area: form;
    width: 100%;
    margin-top: 28px;
  }

  body > #previewWrap {
    grid-area: preview;
    width: 100%;
    margin-top: 28px;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #cardForm,
  #previewWrap {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    margin-top: 22px;
  }

  button {
    min-height: 58px;
    font-size: 18px;
  }
}