/* Word Wizards Academy — Theme variables & base styles */

:root {
  --bg-deep: #0a0420;
  --bg-mid:  #1a0d3d;
  --bg-top:  #2d1b69;

  --indigo:        #1e1b4b;
  --indigo-light:  #312e81;

  --amber:        #f59e0b;
  --amber-light:  #fde68a;
  --amber-dark:   #92400e;

  --parchment:        #fffbeb;
  --parchment-shade:  #fef3c7;

  --emerald: #10b981;
  --rose:    #f43f5e;
  --purple:  #a855f7;
  --pink:    #ec4899;
  --teal:    #14b8a6;

  --text:        #fef3c7;
  --text-dim:    rgba(253, 230, 138, 0.75);
  --text-faint:  rgba(253, 230, 138, 0.45);

  --card-bg:      rgba(30, 27, 75, 0.55);
  --card-border:  rgba(217, 119, 6, 0.35);

  --serif: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
  --sans:  'Quicksand', 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

a { color: var(--amber-light); }

/* Starry background — shared component */
#stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}
.sparkle {
  position: absolute;
  color: #fde68a;
  opacity: 0.3;
  animation: float ease-in-out infinite;
  font-family: var(--serif);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-25px) rotate(180deg); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Magical button — used on all CTA buttons across pages */
.magic-btn {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1e1b4b;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.magic-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px rgba(217, 119, 6, 0.45);
}
.magic-btn.secondary {
  background: rgba(30, 27, 75, 0.5);
  color: var(--amber-light);
  border: 2px solid var(--card-border);
  box-shadow: none;
}

/* Parchment card surface */
.parchment {
  background: linear-gradient(140deg, var(--parchment) 0%, var(--parchment-shade) 100%);
  color: #1e1b4b;
  border-radius: 1.25rem;
  border: 3px solid #d97706;
  padding: 2rem 1.75rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.parchment .corner-tr,
.parchment .corner-bl {
  position: absolute; width: 1.4rem; height: 1.4rem;
  border: 3px solid var(--amber-dark); opacity: 0.7;
}
.parchment .corner-tr { top: 8px;    right: 8px;  border-left: 0; border-bottom: 0; }
.parchment .corner-bl { bottom: 8px; left: 8px;   border-right: 0; border-top: 0; }

/* Form inputs */
.input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(217, 119, 6, 0.35);
  background: rgba(10, 4, 32, 0.45);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.input::placeholder { color: var(--text-faint); }
.input.parchment-input {
  background: rgba(255, 251, 235, 0.7);
  color: #1e1b4b;
  border-color: var(--amber-dark);
}
.input.parchment-input::placeholder { color: rgba(30, 27, 75, 0.4); }

.label {
  display: block;
  font-family: var(--serif);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--amber-dark);
  letter-spacing: 0.05em;
}

.field { margin-bottom: 1.1rem; }
.field .hint { font-size: 0.8rem; color: rgba(30, 27, 75, 0.55); margin-top: 0.3rem; }

/* Inline error/notice */
.notice {
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
  display: none;
}
.notice.show { display: block; }
.notice.error  { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.5); color: #7f1d1d; }
.notice.info   { background: rgba(96, 165, 250, 0.15); border: 1px solid rgba(96, 165, 250, 0.5); color: #1e3a8a; }
.notice.success{ background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.5); color: #064e3b; }

/* Owl mascot helper */
.owl {
  font-size: 4rem;
  display: block;
  filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.55));
  animation: bob 4s ease-in-out infinite;
}
