@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Outfit', sans-serif;
  
  /* Color Palette - Premium Space Slate & Indigo/Violet Accents */
  --bg-primary: #030712;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 55%, #030712 100%);
  --panel-bg: rgba(15, 23, 42, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --card-bg-sub: rgba(255, 255, 255, 0.02);
  --card-border-sub: rgba(255, 255, 255, 0.05);
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.35);
  --color-secondary: #8b5cf6; /* Violet */
  --color-accent-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
  --color-accent-grad-hover: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #a855f7 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.25);
  --color-danger: #f43f5e;
  --color-danger-glow: rgba(244, 63, 94, 0.2);

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  overflow-x: hidden;
}

/* Main Page Wrapper */
.page-wrapper {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Banner Wrapper */
.banner-wrapper {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(99, 102, 241, 0.15);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 280px;
  border-radius: var(--radius-lg);
}

/* Trajetória / Biografia Card */
.bio-card {
  width: 100%;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(99, 102, 241, 0.1);
  padding: 32px 36px;
  transition: var(--transition-smooth);
}

.bio-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.bio-icon {
  width: 24px;
  height: 24px;
  color: #818cf8;
}

.bio-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.bio-content-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.bio-content-wrapper.collapsed {
  max-height: 95px;
}

.bio-content-wrapper.collapsed .bio-fade-overlay {
  opacity: 1;
  pointer-events: auto;
}

.bio-fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.95) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bio-content p {
  font-size: 15px;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.bio-content p:last-child {
  margin-bottom: 0;
}

.btn-toggle-bio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 14px;
  outline: none;
  transition: var(--transition-bounce);
}

.btn-toggle-bio:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-toggle-bio svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.bio-content-wrapper:not(.collapsed) + .btn-toggle-bio svg {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  .bio-card {
    padding: 24px 20px;
  }
  .bio-header h2 {
    font-size: 18px;
  }
  .bio-content p {
    font-size: 14px;
  }
}

/* Glassmorphism Container */
.container {
  width: 100%;
  max-width: 680px;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6),
              0 0 50px rgba(99, 102, 241, 0.12);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* Subtle background glows */
.container::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  background: var(--color-primary);
  filter: blur(110px);
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
}

.container::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 250px;
  height: 250px;
  background: var(--color-secondary);
  filter: blur(110px);
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 32px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  color: #a5b4fc;
  margin-bottom: 12px;
}

.header-badge svg {
  width: 14px;
  height: 14px;
  color: #818cf8;
}

h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: #ffffff;
  text-transform: uppercase;
}

.referrer-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
}

.referrer-card strong {
  color: #f1f5f9;
  font-weight: 600;
}

.referrer-icon {
  width: 16px;
  height: 16px;
  color: #818cf8;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 580px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-span-2 {
    grid-column: span 2;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #cbd5e1;
}

.form-label .required {
  color: var(--color-primary);
}

.form-label .optional {
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.cep-loading-spinner {
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.form-control {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(255, 255, 255, 0.035);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control::placeholder {
  color: #475569;
}

.form-control:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.form-control:focus {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
}

.form-control:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
  color: #818cf8;
}

/* Disabled Form Control */
.form-control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.03);
}

/* Validation styling */
.form-control.is-invalid {
  border-color: var(--color-danger) !important;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px var(--color-danger-glow) !important;
}

.invalid-feedback {
  display: none;
  color: #fb7185;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-group.has-error .invalid-feedback {
  display: block;
}

/* Checkbox Option Groups */
.checkbox-option-group {
  margin-bottom: 20px;
}

.custom-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  transition: var(--transition-smooth);
}

.custom-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
  flex-shrink: 0;
}

.checkbox-box svg {
  width: 13px;
  height: 13px;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-bounce);
}

.custom-checkbox-label input[type="checkbox"]:checked + .checkbox-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.custom-checkbox-label input[type="checkbox"]:checked + .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.custom-checkbox-label:hover .checkbox-box {
  border-color: #818cf8;
}

/* Terms Card Container (Matching screenshot style) */
.terms-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
  transition: var(--transition-smooth);
}

.terms-card:hover {
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(99, 102, 241, 0.3);
}

.terms-label {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

.terms-label a {
  color: #818cf8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition-smooth);
}

.terms-label a:hover {
  color: #a5b4fc;
}

.terms-card .invalid-feedback {
  margin-top: 8px;
}

/* Submit Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-bounce);
  gap: 10px;
  outline: none;
}

.btn-submit {
  width: 100%;
  background: var(--color-accent-grad);
  border: none;
  color: white;
  padding: 16px;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.45);
}

.btn-submit:hover {
  background: var(--color-accent-grad-hover);
  box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.65);
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.6;
}

.btn-icon {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.btn-submit:hover .btn-icon {
  transform: translateX(4px);
}

/* Spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

/* Success View */
.success-card {
  display: none;
  text-align: center;
  padding: 30px 10px;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.success-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--color-success);
  border-radius: 50%;
  color: var(--color-success);
  margin-bottom: 24px;
  box-shadow: 0 0 35px var(--color-success-glow);
}

.success-icon-wrapper svg {
  width: 44px;
  height: 44px;
}

.success-card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  color: white;
}

.success-card p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.btn-restart {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  padding: 14px 28px;
}

.btn-restart:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Modal Styles */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: #0f172a;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  color: white;
}

.modal-body {
  padding: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 18px 0 8px 0;
}

.modal-body h4:first-of-type {
  margin-top: 12px;
}

.modal-body p {
  margin-bottom: 10px;
}

.modal-body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-body strong {
  color: #e2e8f0;
}

.terms-footer-date {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive optimization */
@media (max-width: 480px) {
  body {
    padding: 12px 8px;
  }
  
  .container {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }
  
  h1 {
    font-size: 22px;
  }
  
  .form-control {
    padding: 12px 14px 12px 42px;
    font-size: 14px;
  }
  
  .input-icon {
    left: 14px;
  }
  
  .btn {
    font-size: 15px;
    padding: 14px;
  }
}
