/* AdDrift app styles — brief form, results pages.
   Landing styles live in theme.css.
   Token vars inherited from theme.css. */

/* ---- SHARED / HERO CTA ---- */
.hero-actions {
  margin-top: var(--space-md);
}

.btn-hero {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--accent);
  padding: 0.85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-hero:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---- APP NAV ---- */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}

.nav-cta {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(255, 107, 53, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--accent-glow);
}

/* ---- BRIEF FORM PAGE ---- */
.brief-page {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 107, 53, 0.07) 0%, transparent 55%);
}

.brief-container {
  max-width: 680px;
  margin: 0 auto;
}

.brief-header {
  margin-bottom: 3rem;
}

.brief-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 1.25rem 0 1rem;
}

.brief-header h1 .accent {
  color: var(--accent);
}

.brief-lede {
  color: var(--fg-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 520px;
}

/* ---- FORM ---- */
.brief-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

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

.form-group label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.form-group textarea,
.form-group select {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
  appearance: none;
}

.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea::placeholder {
  color: var(--fg-muted);
  opacity: 0.7;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a8890' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-group select option {
  background: var(--bg-elevated);
}

.form-error {
  color: #ff4d4d;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.2);
  border-radius: 8px;
}

/* ---- BUTTONS ---- */
.btn-primary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 0 30px var(--accent-glow);
  width: 100%;
  text-align: center;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-secondary {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--fg);
}

/* ---- RESULTS PAGE ---- */
.results-page {
  min-height: 100vh;
  padding: 7rem 2rem 5rem;
}

.results-container {
  max-width: 1100px;
  margin: 0 auto;
}

.results-header {
  margin-bottom: 3rem;
}

.results-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1.25rem 0 1.5rem;
  line-height: 1.1;
}

.results-header h1 .accent {
  color: var(--accent);
}

.brief-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--fg-muted);
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.brief-meta span strong {
  color: var(--fg);
  font-weight: 600;
}

/* ---- GENERATING STATE ---- */
.generating-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  gap: 1.5rem;
}

.spinner-wrap {
  margin-bottom: 0.5rem;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 107, 53, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.generating-state h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.generating-sub {
  color: var(--fg-muted);
  max-width: 420px;
  font-size: 1rem;
}

.brief-summary-pill {
  font-size: 0.85rem;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  padding: 0.5rem 1.25rem;
  max-width: 480px;
}

.brief-summary-pill strong {
  color: var(--accent);
}

/* ---- CREATIVES GRID ---- */
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.creative-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.creative-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-2px);
}

.creative-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(255, 107, 53, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  background: var(--accent-glow);
  align-self: flex-start;
}

.creative-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(255, 107, 53, 0.15);
  line-height: 1;
  letter-spacing: -0.03em;
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
}

.creative-headline {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--fg);
  padding-right: 2rem;
}

.creative-body {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.65;
  flex: 1;
}

.creative-cta-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 107, 53, 0.07);
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 53, 0.15);
}

.creative-cta-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

.creative-cta {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.creative-image-dir {
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border-left: 3px solid rgba(255, 107, 53, 0.3);
}

.creative-image-dir-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
}

.creative-image-dir-text {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.55;
  font-style: italic;
}

.copy-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  align-self: flex-start;
  margin-top: auto;
}

.copy-btn:hover {
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--accent);
}

/* ---- ERROR STATE ---- */
.error-state {
  text-align: center;
  padding: 4rem 2rem;
}

.error-state h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.error-state a {
  color: var(--accent);
}

.results-footer {
  display: flex;
  gap: 1rem;
}

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 107, 53, 0.07) 0%, transparent 55%);
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-header {
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 1.25rem 0 0.75rem;
}

.auth-header h1 .accent {
  color: var(--accent);
}

.auth-lede {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
  outline: none;
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--fg-muted);
  opacity: 0.7;
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ---- NAV USER STATE ---- */
.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-email {
  font-size: 0.8rem;
  color: var(--fg-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.nav-logout-btn:hover {
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--accent);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .creatives-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 600px) {
  .brief-page, .results-page {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .brief-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ---- NAV EXTENSIONS (auth state) ---- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link--active {
  color: var(--fg);
}

.nav-user {
  font-size: 0.82rem;
  color: var(--fg-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- DASHBOARD PAGE ---- */
.dashboard-page {
  min-height: 100vh;
  padding: 7rem 2rem 5rem;
}

.dashboard-container {
  max-width: 900px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.dashboard-header h1 .accent {
  color: var(--accent);
}

.dashboard-count {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.dashboard-new-btn {
  width: auto;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---- EMPTY STATE ---- */
.dashboard-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 5rem 2rem;
}

.dashboard-empty-icon {
  font-size: 2.5rem;
  color: var(--accent);
  opacity: 0.5;
}

.dashboard-empty h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-empty p {
  color: var(--fg-muted);
  max-width: 360px;
  line-height: 1.6;
}

/* ---- BRIEFS GRID ---- */
.briefs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brief-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.brief-card:hover {
  border-color: rgba(255, 107, 53, 0.25);
}

.brief-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  gap: 1rem;
}

.brief-card-meta {
  flex: 1;
  min-width: 0;
}

.brief-card-product {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.brief-card-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.brief-card-dot {
  opacity: 0.4;
}

.brief-card-badge {
  color: var(--accent);
  font-weight: 600;
}

.brief-card-preview {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  font-style: italic;
  line-height: 1.4;
}

.brief-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brief-view-btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}

.brief-expand-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--fg-muted);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.25s ease;
}

.brief-expand-btn:hover {
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--accent);
}

/* ---- EXPANDED BRIEF BODY ---- */
.brief-card-body {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem;
  background: var(--bg-elevated);
}

.brief-creatives-loading {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.no-creatives {
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.brief-creatives-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.mini-creative {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mini-creative-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-creative-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(255, 107, 53, 0.15);
  line-height: 1;
}

.mini-creative-headline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.mini-creative-body {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.55;
  flex: 1;
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pagination-btn {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  transition: border-color 0.2s, color 0.2s;
}

.pagination-btn:hover {
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--accent);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

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

  .brief-card-header {
    flex-wrap: wrap;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-page {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
