/* ============================================================
   Aeonik — CoType Foundry (cotypefoundry.com)
   Coloque os arquivos .woff2 licenciados em /fonts/
   ============================================================ */
@font-face {
  font-family: 'Aeonik';
  src: url('/fonts/Aeonik-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/fonts/Aeonik-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/fonts/Aeonik-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/fonts/Aeonik-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Aeonik';
  src: url('/fonts/Aeonik-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:         #040608;
  --border:     rgba(255,255,255,0.09);
  --border-hi:  rgba(255,255,255,0.18);
  --input-bg:   rgba(255,255,255,0.05);
  --text:       #edf1ff;
  --muted:      #8896b0;
  --subtle:     #4a5568;

  --green:      #4ffcb4;
  --red:        #f87171;
  --amber:      #ffc843;
  --blue:       #7ba8ff;

  --font:       'Aeonik', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --ease:       cubic-bezier(0.2, 0, 0, 1);
  --spring:     cubic-bezier(0.16, 1, 0.3, 1);

  --glass-bg:   rgba(6,10,20,0.52);
  --glass-blur: blur(36px) saturate(160%);
  --glass-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 24px 60px rgba(0,0,0,0.35),
    0 6px 16px rgba(0,0,0,0.18);

  --r:   14px;
  --r-s: 10px;
}

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

html {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%,   rgba(79,252,180,0.07)  0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 100% 0%,  rgba(123,168,255,0.09) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255,200,67,0.04)  0%, transparent 50%),
    var(--bg);
}

h1, h2, h3, p { margin: 0; }
a  { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.hidden { display: none !important; }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem max(1.5rem, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(4,6,8,0.8);
  backdrop-filter: var(--glass-blur);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 1.95rem;
  height: 1.95rem;
  place-items: center;
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 12px rgba(0,0,0,0.25);
  font-weight: 900;
  font-size: 0.85rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  transition: color 0.2s var(--ease);
}

.nav a:hover { color: var(--text); }

/* ── Shell ───────────────────────────────────────────────── */
.shell {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  max-width: 740px;
  margin-bottom: 2.5rem;
  animation: fade-up 0.55s var(--spring) both;
}

.eyebrow {
  display: block;
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: -0.005em;
}

/* ── Panel (glass card) ──────────────────────────────────── */
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.4rem;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 200deg at 15% 0%,
    rgba(79,252,180,0.07),
    rgba(123,168,255,0.06),
    transparent 40%
  );
  pointer-events: none;
}

/* ── Grids ───────────────────────────────────────────────── */
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: start;
  animation: fade-up 0.55s 0.08s var(--spring) both;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: start;
  animation: fade-up 0.55s 0.08s var(--spring) both;
}

.left-stack {
  display: grid;
  gap: 1rem;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: rgba(255,255,255,0.04);
}

.tab {
  min-height: 2.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.tab.active {
  color: var(--text);
  background: rgba(255,255,255,0.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 4px 12px rgba(0,0,0,0.2);
}

/* ── Form ────────────────────────────────────────────────── */
.form,
.upload-panel {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

input {
  width: 100%;
  min-height: 2.875rem;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  outline: none;
  padding: 0 0.9rem;
  color: var(--text);
  background: var(--input-bg);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus {
  border-color: rgba(79,252,180,0.4);
  box-shadow:
    0 0 0 3px rgba(79,252,180,0.1),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

input::placeholder { color: var(--subtle); }

/* Password field */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input { padding-right: 3rem; }

.password-toggle {
  position: absolute;
  right: 0.35rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.eye-icon {
  position: relative;
  display: block;
  width: 1.1rem;
  height: 0.68rem;
  border: 1.8px solid currentColor;
  border-radius: 999px;
}

.eye-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%,-50%);
}

.password-toggle.is-visible .eye-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -0.16rem;
  width: 1.5rem;
  height: 1.8px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
}

/* ── Buttons ─────────────────────────────────────────────── */
.primary {
  min-height: 2.75rem;
  border: 0;
  border-radius: var(--r-s);
  padding: 0 1.1rem;
  color: #041a12;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--green), var(--blue) 62%, #c7ddff);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 12px 32px rgba(79,252,180,0.18);
  transition:
    opacity     0.2s var(--ease),
    transform   0.2s var(--spring),
    box-shadow  0.2s var(--ease);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 16px 40px rgba(79,252,180,0.25);
}

.primary:active:not(:disabled) { transform: translateY(0); }

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.ghost {
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 0 0.9rem;
  color: var(--text);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.ghost:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-hi);
}

/* ── Messages ────────────────────────────────────────────── */
.message,
.hint {
  min-height: 1.3rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 0.2s var(--ease);
}

.message.ok,  .hint.ok    { color: var(--green); }
.message.error, .hint.error { color: var(--red); }

/* ── Auth preview steps ──────────────────────────────────── */
.preview-panel {
  display: grid;
  gap: 0.75rem;
}

.preview-step {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.2rem 0.8rem;
  align-items: center;
  min-height: 5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 0.85rem;
  background: var(--input-bg);
  backdrop-filter: blur(16px);
}

.preview-step span {
  grid-row: span 2;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 8px;
  color: #041a12;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.preview-step strong { font-weight: 700; }
.preview-step small  { color: var(--muted); font-size: 0.82rem; }

/* ── Plan panel ──────────────────────────────────────────── */
.plan-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.plan-panel h2 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.compact { min-width: 7.5rem; }

/* ── Section title ───────────────────────────────────────── */
.section-title { margin-bottom: 1rem; }

h2 {
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.row-title h2 { font-size: 1.55rem; }

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  position: relative;               /* Fix: needed for absolute child input */
  display: grid;
  min-height: 9rem;
  place-items: center;
  gap: 0.4rem;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: var(--r-s);
  padding: 1.25rem;
  text-align: center;
  background: var(--input-bg);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.dropzone:hover {
  border-color: rgba(79,252,180,0.35);
  background: rgba(79,252,180,0.04);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone span {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.dropzone small {
  max-width: 26rem;
  color: var(--subtle);
  font-size: 0.8rem;
}

/* ── Subdomain row ───────────────────────────────────────── */
.subdomain-row {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: var(--input-bg);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.subdomain-row:focus-within {
  border-color: rgba(79,252,180,0.4);
  box-shadow: 0 0 0 3px rgba(79,252,180,0.1);
}

.subdomain-row input {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 2.875rem;
}

.subdomain-row input:focus {
  border-color: transparent;
  box-shadow: none;
}

.subdomain-row span {
  flex-shrink: 0;
  padding-right: 0.9rem;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ── Projects list ───────────────────────────────────────── */
.projects-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 1rem 1rem;
  background: var(--input-bg);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.project-card:hover {
  border-color: var(--border-hi);
  background: rgba(255,255,255,0.07);
}

.project-card h3 {
  margin: 0 0 0.2rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.7rem;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.small-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-hi);
}

.danger { color: var(--red); }
.danger:hover { border-color: rgba(248,113,113,0.35); }

/* ── Modal ───────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4,6,8,0.7);
  backdrop-filter: blur(20px) saturate(140%);
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid var(--border-hi);
  border-radius: var(--r);
  padding: 1.5rem;
  background: rgba(8,14,28,0.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 32px 96px rgba(0,0,0,0.55);
  backdrop-filter: blur(40px) saturate(160%);
  animation: modal-in 0.3s var(--spring) both;
}

.icon-btn {
  min-width: 2.5rem;
  padding: 0;
  font-size: 0.8rem;
}

/* ── Pix result ──────────────────────────────────────────── */
.pix-result {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pix-qr-wrap {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 1rem;
  background: rgba(255,255,255,0.05);
}

.pix-qr {
  display: block;
  max-width: 100%;
  border: 8px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

.pix-result textarea {
  min-height: 7.5rem;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  outline: none;
  padding: 0.85rem;
  color: var(--text);
  background: var(--input-bg);
  backdrop-filter: blur(16px);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease);
}

.pix-result textarea:focus { border-color: rgba(79,252,180,0.4); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth-grid,
  .app-grid,
  .project-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .shell {
    width: calc(100% - 1.5rem);
    padding-top: 2.5rem;
  }

  .subdomain-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subdomain-row span {
    padding: 0 0.9rem 0.75rem;
  }
}
