/* ===========================
   RESET
=========================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

/* ===========================
   THEME TOKENS
=========================== */
:root {
  /* Brand */
  --primary: #667eea;
  --secondary: #764ba2;
  --success: #22c55e;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Light theme (default) */
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --card: #f8fafc;
  --card-text: #0f172a;
  --input-bg: rgba(102, 126, 234, 0.06);
  --input-border: rgba(102, 126, 234, 0.18);
  --border: rgba(102, 126, 234, 0.18);
  --shadow: rgba(2, 6, 23, 0.08);
  --glass-light: rgba(255, 255, 255, 0.9);
  --glass-dark: rgba(10, 14, 39, 0.9);

  /* Layout */
  --header-h: 64px; /* mobile header height */
}
@media (min-width: 768px) {
  :root { --header-h: 72px; } /* tablet/desktop header height */
}

/* Dark theme overrides */
body.dark-mode, [data-theme="dark"] {
  --bg: #0a0e27;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --card: #121735;
  --card-text: #e5e7eb;
  --input-bg: rgba(118, 75, 162, 0.16);
  --input-border: rgba(102, 126, 234, 0.35);
  --border: rgba(102, 126, 234, 0.25);
  --shadow: rgba(0, 0, 0, 0.35);
}

/* ===========================
   BASE
=========================== */
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ===========================
   HEADER (fixed, non-overlapping)
=========================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
body.dark-mode .header, [data-theme="dark"] .header {
  background: var(--glass-dark);
  border-bottom: 1px solid var(--border);
}

.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .header-content { padding: 0 20px; }
}

.logo-section { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gradient); color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
  animation: float 3s ease-in-out infinite;
}
.logo-text {
  font-size: 18px; font-weight: 800; letter-spacing: 0.2px;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.header-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle { width: 44px; height: 24px; border-radius: 999px; border: none; background: var(--gradient); position: relative; padding: 2px; cursor: pointer; }
.theme-toggle-ball {
  width: 20px; height: 20px; background: #fff; color: #111827; font-size: 11px;
  border-radius: 50%; position: absolute; top: 2px; left: 2px;
  display: grid; place-items: center; transition: transform 0.25s ease;
}
body.dark-mode .theme-toggle-ball, [data-theme="dark"] .theme-toggle-ball { transform: translateX(20px); }

/* ===========================
   BACKGROUND ORNAMENTS
=========================== */
.bg-animation { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.floating-circle {
  position: absolute; border-radius: 999px;
  background: radial-gradient(100% 100% at 30% 30%, rgba(102,126,234,0.16), rgba(118,75,162,0.08));
  filter: blur(0.3px);
  animation: float-random 18s ease-in-out infinite;
}
.floating-circle:nth-child(1){ width:90px; height:90px; top:12%; left:8%; animation-delay:0s; }
.floating-circle:nth-child(2){ width:140px; height:140px; top:72%; right:10%; animation-delay:5s; }
.floating-circle:nth-child(3){ width:70px; height:70px; bottom:10%; left:50%; animation-delay:10s; }

@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes float-random {
  0%,100%{transform:translate(0,0) scale(1)}
  25%{transform:translate(26px,-24px) scale(1.08)}
  50%{transform:translate(-16px,18px) scale(0.94)}
  75%{transform:translate(18px,24px) scale(1.03)}
}

/* ===========================
   MAIN CONTAINER
=========================== */
.main-container {
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  position: relative;

  /* push content below fixed header */
  padding-top: calc(var(--header-h) + 16px) !important;
  padding-left: 16px; padding-right: 16px; padding-bottom: 28px;

  background: linear-gradient(180deg, rgba(102,126,234,0.05) 0%, rgba(118,75,162,0.05) 100%);
}
@media (min-width: 1024px) {
  .main-container { padding-top: calc(var(--header-h) + 28px) !important; padding-left: 20px; padding-right: 20px; }
}

/* ===========================
   CARD
=========================== */
.form-card {
  background: var(--card); color: var(--card-text);
  border-radius: 22px; padding: 28px 22px;
  box-shadow: 0 20px 60px var(--shadow);
  width: 100%; max-width: 420px;
  position: relative; overflow: hidden;
}
.form-card::before {
  content: ""; position: absolute; inset: -2px; border-radius: 22px; z-index: -1;
  background: var(--gradient); opacity: 0; transition: opacity 0.3s ease;
}
.form-card:hover::before { opacity: 0.85; }

.form-header { text-align: center; margin-bottom: 24px; }
.form-title {
  font-size: 28px; font-weight: 900; letter-spacing: -0.2px; line-height: 1.2; margin-bottom: 8px;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.form-subtitle { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ===========================
   FORM
=========================== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  color: var(--text); opacity: 0.85; margin-bottom: 8px;
}

.form-input {
  width: 100%; padding: 13px 14px; font-size: 16px;
  background: var(--input-bg); color: var(--text);
  border: 2px solid var(--input-border); border-radius: 12px;
  transition: border-color 0.25s ease, transform 0.2s ease, background 0.25s ease;
}
.form-input::placeholder { color: color-mix(in srgb, var(--text) 50%, transparent); }
.form-input:focus {
  outline: none; border-color: var(--primary);
  background: color-mix(in srgb, var(--input-bg), white 6%);
  transform: translateY(-1px);
}

.submit-btn {
  width: 100%; padding: 15px 16px; border-radius: 12px;
  background: var(--gradient); color: #fff; border: none;
  font-size: 16px; font-weight: 700; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 12px 30px rgba(102,126,234,0.28);
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(102,126,234,0.35); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%{transform:scale(1)} 50%{transform:scale(1.02)} 100%{transform:scale(1)} }

.loading-spinner {
  display: none; width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
.submit-btn.is-loading .loading-spinner { display: inline-block; }
.submit-btn.is-loading #btnText { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline messages */
.msg-error, #formError { display: none; color: #ef4444; font-size: 13px; margin: 8px 0 10px; }
.msg-success, #formSuccess { display: none; color: #10b981; font-size: 13px; margin: 8px 0 10px; }

/* ===========================
   TRUST / SOCIAL / FEATURES
=========================== */
.trust-badges {
  display: flex; justify-content: center; gap: 20px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}
.trust-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trust-icon { font-size: 22px; }
.trust-text { font-size: 11px; color: var(--muted); }

.social-scroll-container { margin-top: 26px; overflow: hidden; }
.social-scroll-title { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.social-scroll { display: flex; gap: 22px; animation: marquee-left 20s linear infinite; }
.social-scroll-item {
  min-width: 50px; height: 50px; border-radius: 12px; font-size: 22px;
  display: grid; place-items: center; color: var(--text);
  background: rgba(102,126,234,0.10);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.social-scroll-item:hover { transform: scale(1.12); background: var(--gradient); color: #fff; }

.tech-scroll-container { margin-top: 24px; overflow: hidden; }
.tech-scroll-title { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.tech-scroll { display: flex; gap: 16px; animation: marquee-right 24s linear infinite; }
.tech-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  color: var(--text); background: rgba(102,126,234,0.08); border: 1px solid var(--border);
  transition: background 0.25s ease, transform 0.25s ease;
}
.tech-item:hover { background: rgba(102,126,234,0.18); transform: translateY(-2px); }
.tech-icon { font-size: 18px; }

@keyframes marquee-left { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
@keyframes marquee-right { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* ===========================
   SUCCESS POPUP
=========================== */
#successMessage {
  /* Hidden unless .show is added by JS */
  display: none !important;
  opacity: 0; visibility: hidden; pointer-events: none;

  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card); color: var(--card-text);
  padding: 28px; border-radius: 18px; min-width: 260px;
  text-align: center; z-index: 2000;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px var(--shadow);
}
#successMessage.show {
  display: block !important;
  opacity: 1; visibility: visible; pointer-events: auto;
  animation: popup 0.45s ease;
}
.success-icon {
  width: 58px; height: 58px; border-radius: 999px;
  background: var(--success); color: #fff; font-weight: 900; font-size: 28px;
  display: grid; place-items: center; margin: 0 auto 14px;
}
@keyframes popup { 0%{transform:translate(-50%,-50%) scale(0.85); opacity:0} 100%{transform:translate(-50%,-50%) scale(1); opacity:1} }

/* ===========================
   UTILITIES
=========================== */
.gradient-text {
  background: linear-gradient(270deg, #667eea, #764ba2, #667eea);
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: gradient-shift 3s ease infinite;
}
@keyframes gradient-shift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .form-card { padding: 24px 18px; border-radius: 20px; }
  .form-title { font-size: 26px; }
  .social-scroll-item { min-width: 46px; height: 46px; font-size: 20px; }
  .tech-item { padding: 6px 10px; font-size: 12px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .main-container { padding-top: calc(var(--header-h) + 12px) !important; }
  .form-card { padding: 20px; }
  .form-group { margin-bottom: 14px; }
}

/* End of stylesheet */