* {
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8fbff, #eef2f7);
  color: #0f172a;
  margin: 0;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.5px;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#user-status {
  font-size: 14px;
  color: #4b5563;
}

#user-info > * {
  white-space: nowrap;
}

main {
  padding: 24px;
  display: grid;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.buy-page main {
  max-width: 1280px;
}

stripe-pricing-table {
  width: 100%;
  display: block;
}

.footer {
  margin: 24px auto;
  max-width: 960px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
}

.footer a {
  color: #4b5563;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.faq {
  margin-top: 16px;
  color: #4b5563;
}

.pricing-note {
  text-align: center;
  margin-top: 12px;
}

.faq ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.faq li strong {
  color: #0f172a;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.history-item .prompt {
  font-weight: 600;
  margin-bottom: 4px;
}

.history-item .meta {
  color: #6b7280;
  font-size: 13px;
}

.history-item video {
  width: 100%;
  max-width: 500px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

section {
  display: grid;
  gap: 16px;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #0f172a;
}

.label-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.prompt-examples {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
}

input[type="checkbox"] {
  width: auto;
  padding: 0;
}

textarea {
  resize: vertical;
}

.switcher .linkish {
  padding: 8px 12px;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.error {
  color: #ffbdbd;
  font-size: 14px;
}

.success {
  color: #c5ffd2;
  font-size: 14px;
}

#video-result video {
  width: 100%;
  border-radius: 10px;
  margin-top: 12px;
  border: 1px solid #e5e7eb;
}

button,
.linkish {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  width: auto;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

button:hover,
.linkish:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

form button {
  width: 100%;
}

header .linkish,
.switcher .linkish,
.history-actions .linkish {
  width: auto;
}

.muted {
  color: #6b7280;
  margin-top: 0;
}

.reminder {
  margin-top: 12px;
  color: #b45309;
  font-size: 14px;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.auth-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  z-index: 2;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.2);
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #0f172a;
}

.forgot-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: #1d4ed8;
  text-decoration: underline;
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.checkbox-row a {
  color: #1d4ed8;
}

@media (min-width: 720px) {
  #auth-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}
