/* ═══════════════════════════════════════
   CAMPUS SJD — SHARED DESIGN SYSTEM
   Used by newsletter.html, newsletter/index.html & coming-soon.html
   Newsletter values are canonical.
═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.6s ease, color 0.6s ease;
}

/* ═══════════════════════════════════════
   THEME TOKENS
═══════════════════════════════════════ */
:root {
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, sans-serif;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-premium: all 0.7s cubic-bezier(0.32, 0.72, 0, 1);
  --transition-fast: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --noise-opacity: 0.45;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg-primary: #07080C;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-ultra-muted: rgba(255, 255, 255, 0.25);
  --cta-primary: #C28348;
  --cta-hover: #d4985c;
  --cta-text: #FFFFFF;
  --cta-text-hover: #FFFFFF;
  --gold-primary: #C28348;
  --gold-light: #F6C89F;
  --badge-bg: rgba(194, 131, 72, 0.08);
  --badge-border: rgba(194, 131, 72, 0.25);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-border-focus: #C28348;
  --input-text: #FFFFFF;
  --input-placeholder: rgba(255, 255, 255, 0.3);
  --input-icon: rgba(255, 255, 255, 0.35);
  --input-icon-focus: #C28348;
  --shadow-card: 0 20px 45px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-btn: 0 4px 20px rgba(194, 131, 72, 0.25);
  --shadow-btn-hover: 0 8px 30px rgba(194, 131, 72, 0.4);
  --divider: rgba(255, 255, 255, 0.06);
  --theme-icon: #F6C89F;
  --particle-color: rgba(255, 255, 255, 0.06);
  --scrollbar-track: rgba(255, 255, 255, 0.03);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --error-color: #EF4444;
  --success-color: #3DE073;
  --modal-bg: linear-gradient(160deg, rgba(31, 42, 68, 0.88), rgba(11, 14, 20, 0.95));
  --modal-border: 1px solid rgba(100, 150, 220, 0.18);
  --modal-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(100, 150, 220, 0.1);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #B8A684;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFFFF;
  --border-card: rgba(0, 0, 0, 0.1);
  --border-card-hover: rgba(194, 131, 72, 0.35);
  --text-primary: #1E293B;
  --text-secondary: rgba(30, 41, 59, 0.7);
  --text-muted: rgba(30, 41, 59, 0.5);
  --text-ultra-muted: rgba(30, 41, 59, 0.3);
  --cta-primary: #C28348;
  --cta-hover: #d4985c;
  --cta-text: #FFFFFF;
  --cta-text-hover: #FFFFFF;
  --gold-primary: #C28348;
  --gold-light: #8D5E36;
  --badge-bg: rgba(194, 131, 72, 0.1);
  --badge-border: rgba(194, 131, 72, 0.3);
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-border: rgba(0, 0, 0, 0.12);
  --input-border-focus: #C28348;
  --input-text: #1E293B;
  --input-placeholder: rgba(30, 41, 59, 0.35);
  --input-icon: rgba(30, 41, 59, 0.35);
  --input-icon-focus: #C28348;
  --shadow-card: 0 8px 32px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 4px 16px rgba(194, 131, 72, 0.2);
  --shadow-btn-hover: 0 8px 24px rgba(194, 131, 72, 0.3);
  --divider: rgba(0, 0, 0, 0.06);
  --theme-icon: #8D5E36;
  --particle-color: rgba(194, 131, 72, 0.08);
  --scrollbar-track: rgba(0, 0, 0, 0.03);
  --scrollbar-thumb: rgba(194, 131, 72, 0.2);
  --error-color: #DC2626;
  --success-color: #059669;
  --noise-opacity: 0.32;
  --modal-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(245, 240, 230, 0.92));
  --modal-border: 1px solid rgba(194, 131, 72, 0.25);
  --modal-shadow: 0 25px 60px -15px rgba(60, 40, 20, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 9999px; }

/* ═══════════════════════════════════════
   FOCUS VISIBLE
═══════════════════════════════════════ */
input:focus { outline: none; }

.btn-subscribe:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--input-border-focus);
  outline-offset: 3px;
}

/* ═══════════════════════════════════════
   KEY ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toggleFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pageEntrance {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes btnEntrance {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes underlineGrow {
  to { transform: scaleX(1); }
}

@keyframes modalIconBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ═══════════════════════════════════════
   THEME TOGGLE
═══════════════════════════════════════ */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-premium);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(-12px);
  animation: toggleFadeIn 0.8s 0.3s forwards;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--gold-primary);
  background: var(--bg-card-hover);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--theme-icon);
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.theme-toggle.is-dark svg {
  transform: rotate(180deg);
}

/* ═══════════════════════════════════════
   BADGE
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--gold-light);
  width: fit-content;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeSlideUp 0.7s 0.3s forwards;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-color);
  animation: pulse-dot 2s infinite;
}

/* ═══════════════════════════════════════
   CARD LOGO
═══════════════════════════════════════ */
.card-logo {
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeSlideUp 0.7s 0.2s forwards;
}

.card-logo img {
  max-width: 60px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

[data-theme="light"] .card-logo img {
  filter: brightness(0) saturate(100%) invert(13%) sepia(25%) saturate(1800%) hue-rotate(175deg);
}

/* ═══════════════════════════════════════
   FORM / INPUT FIELD STYLES
═══════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeSlideUp 0.7s 0.8s forwards;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: var(--input-border-focus);
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(194, 131, 72, 0.12);
}

.input-wrapper.has-error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-wrapper.is-valid {
  border-color: var(--success-color);
}

.input-icon {
  flex-shrink: 0;
  padding-left: 16px;
  display: flex;
  align-items: center;
  color: var(--input-icon);
  transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
  color: var(--input-icon-focus);
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 16px 16px 16px 12px;
  color: var(--input-text);
  font-size: 1rem;
  font-family: var(--font-body);
  min-width: 0;
}

.input-wrapper input::placeholder {
  color: var(--input-placeholder);
}

.input-status {
  flex-shrink: 0;
  padding-right: 16px;
  display: flex;
  align-items: center;
}

.input-status .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-card);
  border-top-color: var(--input-icon-focus);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.input-status .check {
  display: none;
  color: var(--success-color);
}

.input-status .error-icon {
  display: none;
  color: var(--error-color);
}

.input-wrapper.is-checking .spinner { display: block; }
.input-wrapper.is-valid .check { display: block; }
.input-wrapper.is-valid .spinner { display: none; }
.input-wrapper.has-error .error-icon { display: block; }
.input-wrapper.has-error .spinner { display: none; }

.error-text {
  font-size: 0.8rem;
  color: var(--error-color);
  min-height: 20px;
  padding-left: 4px;
  transition: var(--transition-fast);
}

/* ═══════════════════════════════════════
   SUBSCRIBE BUTTON
═══════════════════════════════════════ */
.btn-subscribe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 28px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.03rem;
  border-radius: 9999px;
  border: none;
  background: var(--cta-primary);
  color: var(--cta-text);
  cursor: pointer;
  gap: 12px;
  transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: var(--shadow-btn);
  user-select: none;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  animation: btnEntrance 0.8s 0.85s forwards;
}

.btn-subscribe::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-25deg);
  transition: left 0.8s ease;
}

.btn-subscribe:hover:not(:disabled)::before {
  left: 125%;
}

.btn-subscribe:hover:not(:disabled) {
  background: var(--cta-hover);
  color: var(--cta-text-hover);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px) scale(1.01);
}

.btn-subscribe:active:not(:disabled) {
  transform: scale(0.97) !important;
}

.btn-subscribe:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-subscribe svg {
  width: 20px;
  height: 20px;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-subscribe:hover:not(:disabled) svg {
  transform: translate(4px, -2px);
}

.btn-subscribe .btn-text {
  transition: opacity 0.25s ease;
}

.btn-subscribe.is-loading .btn-text {
  opacity: 0;
}

.btn-subscribe .btn-spinner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(0,0,0,0.15);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-subscribe.is-loading .btn-spinner {
  opacity: 1;
}

[data-theme="dark"] .btn-subscribe .btn-spinner {
  border-color: rgba(255,255,255,0.2);
  border-top-color: #FFFFFF;
}

[data-theme="light"] .btn-subscribe .btn-spinner {
  border-color: rgba(255,255,255,0.2);
  border-top-color: #FFFFFF;
}
