/* ============================================
   XP TRADER – Página inicial (index.php)
   ============================================ */

:root {
  --xp-bg: #030712;
  --xp-surface: #0f172a;
  --xp-surface-2: #1e293b;
  --xp-border: rgba(148, 163, 184, 0.2);
  --xp-text: #f1f5f9;
  --xp-text-muted: #94a3b8;
  --xp-accent: #38bdf8;
  --xp-accent-2: #6847F5;
  --xp-success: #16a34a;
  --xp-gradient: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(104, 71, 245, 0.1));
  --xp-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --xp-radius: 16px;
  --xp-radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--xp-bg);
  color: var(--xp-text);
  line-height: 1.6;
  overflow-x: hidden;
}

body.index-page {
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(104, 71, 245, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(56, 189, 248, 0.06), transparent);
}

/* ========== Header ========== */
.index-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--xp-border);
  transition: background 0.2s ease;
}

.index-header .index-logo-link {
  display: block;
  line-height: 0;
}

.index-header .index-logo {
  display: block;
  height: 64px;
  width: auto;
  object-fit: contain;
}

.index-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.index-btn {
  padding: 10px 20px;
  border-radius: var(--xp-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.index-btn:active {
  transform: scale(0.98);
}

.index-btn--ghost {
  background: transparent;
  color: var(--xp-text);
  border: 1px solid var(--xp-border);
}

.index-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.4);
}

.index-btn--primary {
  background: linear-gradient(135deg, var(--xp-accent), #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.index-btn--primary:hover {
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.45);
}

/* ========== Hero ========== */
.index-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  text-align: center;
}

.index-hero__inner {
  max-width: 720px;
}

.index-hero__badge {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--xp-accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
}

.index-hero__title {
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
}

.index-hero__title span {
  background: linear-gradient(135deg, var(--xp-accent), var(--xp-accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.index-hero__subtitle {
  margin: 0 0 32px;
  font-size: 1.15rem;
  color: var(--xp-text-muted);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.index-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 1rem;
  border-radius: var(--xp-radius-sm);
  background: linear-gradient(135deg, var(--xp-accent), #0ea5e9);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.index-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(56, 189, 248, 0.5);
}

/* ========== Seção de recursos (cards) ========== */
.index-section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.index-section__title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xp-accent);
}

.index-section__headline {
  margin: 0 0 48px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  max-width: 560px;
}

.index-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.index-card {
  position: relative;
  padding: 28px;
  background: var(--xp-surface);
  border: 1px solid var(--xp-border);
  border-radius: var(--xp-radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.index-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--xp-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.index-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-4px);
  box-shadow: var(--xp-shadow);
}

.index-card:hover::before {
  opacity: 1;
}

.index-card__tag {
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--xp-accent);
  background: rgba(56, 189, 248, 0.12);
  border-radius: 6px;
}

.index-card__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.index-card__value {
  margin: 0 0 4px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--xp-accent);
  letter-spacing: -0.02em;
}

.index-card__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--xp-text-muted);
  line-height: 1.55;
}

/* Card larga (2 colunas) */
.index-card--wide {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .index-card--wide {
    grid-column: span 2;
  }
}

/* ========== Seção app ========== */
.index-app {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.index-app__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .index-app__grid {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.index-app__image {
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: var(--xp-radius);
  box-shadow: var(--xp-shadow);
}

.index-app__title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.index-app__text {
  margin: 0 0 24px;
  font-size: 1.05rem;
  color: var(--xp-text-muted);
}

/* ========== CTA final ========== */
.index-cta {
  padding: 100px 24px;
  text-align: center;
  background: var(--xp-gradient);
  border-top: 1px solid var(--xp-border);
  border-bottom: 1px solid var(--xp-border);
}

.index-cta__inner {
  max-width: 640px;
  margin: 0 auto;
}

.index-cta__overline {
  display: block;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--xp-accent);
}

.index-cta__title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
}

.index-cta__btn {
  display: inline-flex;
  padding: 16px 36px;
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--xp-radius-sm);
  background: linear-gradient(135deg, var(--xp-accent), #0ea5e9);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.index-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(56, 189, 248, 0.5);
}

/* ========== Footer ========== */
.index-footer {
  padding: 48px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.index-footer__logo-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.index-footer__logo {
  display: block;
  margin-bottom: 24px;
  width: 180px;
  height: auto;
  opacity: 0.95;
}

.index-footer__copy {
  margin: 0 0 24px;
  font-size: 0.9rem;
  color: var(--xp-text-muted);
}

.index-footer__legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--xp-text-muted);
  opacity: 0.85;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ========== Scroll to top ========== */
.index-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  width: 48px;
  height: 48px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--xp-surface);
  border: 1px solid var(--xp-border);
  border-radius: 50%;
  color: var(--xp-text);
  cursor: pointer;
  box-shadow: var(--xp-shadow);
  transition: background 0.2s ease, transform 0.15s ease;
}

.index-scroll-top:hover {
  background: var(--xp-surface-2);
  transform: translateY(-2px);
}

.index-scroll-top.is-visible {
  display: flex;
}

/* ========== Utilitários ========== */
.index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 767px) {
  .index-hero {
    padding: 100px 20px 60px;
  }
  .index-section,
  .index-app {
    padding: 56px 20px;
  }
  .index-cta {
    padding: 64px 20px;
  }
}

/* ========== Modais Login / Cadastro ========== */
.index-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(12px);
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.index-modal-overlay[aria-hidden="false"] {
  display: flex;
}

.index-modal-box {
  position: relative;
  max-width: 440px;
  width: 100%;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(104, 71, 245, 0.15), var(--xp-surface));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.index-modal-box > * {
  position: relative;
  z-index: 1;
}

.index-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem 0.25rem;
}

.index-modal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--xp-border);
}

.index-modal-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #facc15, #eab308);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.8);
}

.index-modal-brand-text {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.index-modal-heading {
  padding: 0.25rem 1.5rem 1rem;
}

.index-modal-title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f9fafb;
}

.index-modal-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--xp-text-muted);
}

.index-modal-close {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--xp-border);
  border-radius: 999px;
  color: #e5e7eb;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 6px 12px;
  font-family: inherit;
  transition: background 0.2s ease, transform 0.15s ease;
}

.index-modal-close:hover {
  background: var(--xp-surface-2);
  transform: translateY(-1px);
}

.index-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem;
}

.index-modal-label {
  font-size: 0.8rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.index-modal-input-group {
  position: relative;
}

.index-modal-input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border-radius: var(--xp-radius-sm);
  border: 1px solid var(--xp-border);
  background: rgba(15, 23, 42, 0.8);
  color: #f3f4f6;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.index-modal-input::placeholder {
  color: #64748b;
}

.index-modal-input:focus {
  outline: none;
  border-color: var(--xp-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.index-modal-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  color: var(--xp-text-muted);
}

.index-modal-eye-icon {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.index-modal-eye.is-active .index-modal-eye-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.index-modal-submit {
  width: 100%;
  padding: 14px;
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--xp-radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, var(--xp-accent), #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.index-modal-submit:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.index-modal-submit:active {
  transform: scale(0.98);
}

.index-modal-switch {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--xp-text-muted);
  text-align: center;
}

.index-modal-switch-btn {
  background: none;
  border: none;
  color: var(--xp-accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}

.index-modal-switch-btn:hover {
  text-decoration: underline;
}
