:root {
  --bg: #0d0d0f;
  --panel: #17171b;
  --panel-2: #202027;
  --text: #f5f5f7;
  --muted: #9b9ba4;
  --border: #2d2d35;
  --accent: #ffffff;
  --accent-text: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #1b1b22 0%, #0d0d0f 45%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 60px 0 80px;
}

.hero {
  margin-bottom: 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.subtitle {
  max-width: 600px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.card {
  background: rgba(23, 23, 27, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.card + .card {
  margin-top: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.card-header > div { min-width: 0; }

.card-header h2,
.hashtags-block h3 {
  margin: 0;
}

.card-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.upload-zone {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #4a4a55;
  border-radius: 20px;
  background: #111115;
  transition: 0.2s ease;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: #888894;
  background: #15151a;
}

.upload-zone strong {
  font-size: 17px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 14px;
}

.upload-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--panel-2);
  font-size: 27px;
}

.file-info {
  margin-top: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-radius: 14px;
  background: var(--panel-2);
}

.file-info > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.file-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info span {
  color: var(--muted);
  font-size: 13px;
}

.video-preview {
  width: 100%;
  max-height: 460px;
  margin-top: 16px;
  border-radius: 18px;
  background: #000;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  padding: 15px 18px;
  background: var(--accent);
  color: var(--accent-text);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.92;
}

.primary-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.secondary-button {
  padding: 10px 14px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-button:hover {
  background: #292932;
}

.text-button {
  border: 0;
  background: transparent;
  color: #d4d4da;
}

.status-text {
  min-height: 20px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.caption-list {
  display: grid;
  gap: 12px;
}

.caption-item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #111115;
  font-size: 18px;
  line-height: 1.45;
}

.caption-number {
  display: inline-block;
  margin-right: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hashtags-block {
  margin-top: 28px;
}

.hashtag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.hashtag {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: #ddddE3;
  font-size: 14px;
}

.feedback-block {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.feedback-block label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  background: #111115;
  color: var(--text);
  line-height: 1.5;
}

textarea:focus {
  border-color: #676773;
}

textarea::placeholder {
  color: #6f6f79;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 900px);
    padding-top: 34px;
  }

  .card {
    padding: 18px;
    border-radius: 19px;
  }

  .card-header {
    align-items: flex-start;
  }

  .upload-zone {
    min-height: 200px;
  }
}
/* Account, pricing, and commercial UI */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 54px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-email {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.credit-pill,
.cost-badge,
.score-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
}
.credit-pill,
.cost-badge {
  padding: 8px 11px;
}

.score-badge {
  padding: 9px 12px;
}

.ghost-button {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.ghost-button:hover {
  background: var(--panel-2);
}

.auth-card {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.auth-card .card-header { justify-content: center; text-align: center; }
.auth-form .primary-button { margin-top: 4px; }
.auth-form .status-text { margin-top: 0; }
.forgot-password { justify-self: end; padding: 4px 0; font-size: 13px; }
#backToLoginBtn { display: block; margin: 16px auto 0; padding: 8px; }
.social-login { margin-top: 18px; text-align: center; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.social-buttons { display: grid; gap: 10px; }
.social-buttons button { min-height: 44px; }
.social-buttons button:disabled { opacity: .45; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #111115;
}

.auth-tab {
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.active {
  background: var(--panel-2);
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label > span {
  font-size: 13px;
  font-weight: 700;
}
.auth-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: #111115;
  color: var(--text);
}

.auth-form input:focus {
  border-color: #676773;
}

.pricing-card {
  margin-top: 22px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.price-option {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #111115;
}

.price-option h3 {
  margin: 0;
  font-size: 17px;
}

.pack-price {
  display: block;
  margin-top: 18px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.price-option p {
  margin: 5px 0 18px;
  color: var(--muted);
}

.buy-button {
  width: 100%;
  margin-top: auto;
}

.buy-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fine-print,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.fine-print {
  margin: 14px 2px 0;
}

#creatorSection {
  margin-top: 22px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.feedback-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.feedback-title-row label {
  margin: 0;
}

.feedback-title-row span {
  color: var(--muted);
  font-size: 13px;
}

.activity-card {
  margin-top: 22px;
}
.transaction-list {
  display: grid;
  gap: 8px;
}

.transaction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #111115;
}

.transaction-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.caption-item, .status-text, .fine-print { overflow-wrap: anywhere; }
.cost-badge, .credit-pill, .feedback-title-row > span,
.transaction-row > strong, .file-info > button { flex-shrink: 0; }
.cost-badge, .credit-pill, .feedback-title-row > span { white-space: nowrap; }
.price-option, .auth-form, .auth-form label, .auth-form input { min-width: 0; }
button:focus-visible, a:focus-visible, .upload-zone:focus-within {
  outline: 2px solid #b9b9d0;
  outline-offset: 4px;
}
button:disabled { cursor: not-allowed; }

.transaction-row span {
  color: var(--muted);
  font-size: 12px;
}

.amount-positive {
  color: #b8f7c8;
}

.amount-negative {
  color: #f1b6b6;
}

@media (max-width: 760px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .price-option {
    min-height: 0;
  }

  .topbar {
    align-items: flex-start;
  }

  .account-email {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar {
    margin-bottom: 38px;
    flex-wrap: wrap;
  }

  .account-bar {
    gap: 6px;
    justify-content: flex-start;
  }

  .result-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .app-shell { width: calc(100% - 32px); }
  h1 { font-size: clamp(34px, 9vw, 46px); line-height: 1.08; }
  .subtitle { font-size: 16px; }
  .card-header { gap: 12px; }
  .auth-tab { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.site-footer { margin-top: 28px; text-align: center; font-size: 13px; }
.site-footer a, .legal-card a { color: #d4d4da; }
.legal-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 60px 0 80px; }
.legal-card { margin-top: 48px; }
.legal-card h1 { font-size: clamp(38px, 7vw, 62px); }
.legal-card h2 { margin: 34px 0 10px; font-size: 21px; }
.legal-card p { color: var(--muted); line-height: 1.7; }
