
/* === Psychotest Modern Layout (v2.0) =====================================
   - Cleaner, roomier layout inspired by myiq.com personality quiz
   - Card-style questions, big tappable Likert options
   - Strong primary CTA, subtle secondary actions
   - Mobile-first; no markup changes required
=========================================================================== */

:root{
  --bg: #ffffff;
  --card: #ffffff;
  --text: #000000;
  --muted: #666666;
  --line: #e5e5e5;
  --primary: #000000;
  --primary-weak: #f5f5f5;
  --primary-weak-2: #dddddd;
  --accent: #000000;
  --danger: #cc0000;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(0,0,0,.08);
  --shadow-inset: inset 0 0 0 1px var(--line);
  --focus: 0 0 0 3px rgba(0,0,0,.3);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0a0a0a;
    --card: #111111;
    --text: #ffffff;
    --muted: #bbbbbb;
    --line: #333333;
    --primary: #ffffff;
    --primary-weak: #1a1a1a;
    --primary-weak-2: #222222;
    --accent: #ffffff;
    --danger: #ff3333;
    --shadow: 0 10px 28px rgba(0,0,0,.40);
    --shadow-inset: inset 0 0 0 1px var(--line);
    --focus: 0 0 0 3px rgba(255,255,255,.45);
  }
}

/* Reset & base */
*{ box-sizing: border-box; }
html, body{ margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family: 'Comic Sans MS', 'Comic Neue', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",
               "Noto Sans TC","Noto Sans JP","Noto Sans KR","Noto Naskh Arabic",
               "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: .2px;
}

.container{ max-width: 860px; margin: 0 auto; padding: 20px; }

/* ===== Header ===== */
header.container{
  text-align: center;
  padding: 56px 20px 22px;
  border-bottom: 2px dashed var(--primary);
  background: var(--primary-weak);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
header h1{
  margin: 0 0 8px;
  font-size: clamp(32px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--primary);
  text-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.sub{
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ===== Form Card ===== */
form#quizForm{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  margin-top: 28px;
  border: 1px solid var(--line);
}

/* ===== Each Question (card-style) ===== */
fieldset{
  border: none;
  background: var(--card);
  padding: 18px;
  margin: 0 0 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
legend{
  font-weight: 700;
  font-size: 13px;
  padding: 0;
  margin-bottom: 6px;
  color: var(--muted);
}
.q-label{
  display: block;
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 14px;
}

/* ===== Likert options (big, tappable) ===== */
.options{
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 560px){
  .options{ grid-template-columns: 1fr; }
}

.opt{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  background: var(--primary-weak);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  box-shadow: var(--shadow-inset);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  cursor: pointer;
  user-select: none;
}
.opt:hover{
  transform: translateY(-1px);
  background: var(--primary-weak-2);
  box-shadow: var(--shadow);
}
.opt:active{ transform: translateY(0); }

/* hide native radio, full-tile hit area */
.opt input[type="radio"]{ appearance: none; -webkit-appearance: none; display: none; }

/* When JS toggles .checked on the label */
.opt.checked{
  background: var(--primary-weak-2);
  border-color: var(--primary);
  box-shadow: var(--focus), var(--shadow);
}

/* inner label text */
.opt span{ font-size: 14px; font-weight: 600; text-align: center; }

/* ===== Actions ===== */
.actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.btn{
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 200px;
  min-width: 180px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: var(--shadow);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn:focus-visible{ outline: none; box-shadow: var(--focus), var(--shadow); }

.btn:not(.ghost){
  background: var(--primary);
  color: var(--bg);
}
.btn.ghost{
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-inset);
}
.btn.ghost:hover{
  background: var(--primary-weak);
  color: var(--primary);
  border-color: var(--text);
}

.emoji{
  margin-left: 6px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== Tiny text & footer ===== */
.tiny{
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}
.foot{
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px 56px;
}

/* ===== Utilities ===== */
.hidden{ display: none !important; }

/* ===== Optional: result pages styling (future use) ===== */
.result-wrap{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.5vw, 26px);
  box-shadow: var(--shadow);
}
.result-type{
  font-size: clamp(22px, 2.2vw, 28px);
  margin: 0 0 6px;
  font-weight: 800;
}
.badge{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--primary-weak);
  font-size: 12px;
  margin-left: 8px;
}
.kv{ margin-top: 10px; font-size: 14px; color: var(--text); }
.kv code{
  background: rgba(148,163,184,.18);
  padding: 2px 6px;
  border-radius: 8px;
}

.hr{ height: 1px; background: var(--line); margin: 18px 0; }

/* ===== Focus outlines for keyboard users ===== */
a, button, input, select, textarea{ outline-color: var(--primary); outline-offset: 2px; }

/* ===== Smooth scrolling (if any anchors) ===== */
html{ scroll-behavior: smooth; }
