/* ============================================================
   AI Daddy Feedback – Design System
   Matches AI Policy Generator's visual language exactly.
   ============================================================ */

:root {
  /* Core palette (from AI Policy Generator) */
  --navy-primary: #0F172A;
  --navy-dark: #020617;
  --white: #ffffff;
  --text-dark: #1E293B;
  --text-gray: #475569;
  --text-light: #94A3B8;
  --accent-blue: #3B82F6;
  --bg-offwhite: #F8FAFC;
  --border-light: #E2E8F0;

  /* Shadows (from AI Policy Generator) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  /* Star rating */
  --star-off: #CBD5E1;
  --star-on: #F59E0B;
  --star-hover: #FBBF24;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-offwhite);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Background Gradient (matches Policy Generator) ---- */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 50%, #F1F5F9 100%);
  z-index: -1;
}

/* ---- Page Shell ---- */
.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/* ---- Main Container (matches .assessment-container) ---- */
.feedback-container {
  max-width: 680px;
  width: 100%;
  background: var(--white);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
  border-radius: 0;
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out;
}

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

/* ---- Navy Header Bar (exact match to Policy Generator) ---- */
.welcome-header {
  background: var(--navy-primary);
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-image {
  height: 28px;
  width: auto;
  display: block;
}

.logo a {
  display: flex;
  text-decoration: none;
}

/* ---- Content Area (matches .welcome-content) ---- */
.welcome-content {
  padding: 40px 32px;
}

.content-wrapper {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

/* ---- Badge (exact match to Policy Generator) ---- */
.badge-container {
  margin-bottom: 20px;
}

.badge-new {
  display: inline-block;
  background: #EFF6FF;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #DBEAFE;
}

/* ---- Headline (matches .main-headline) ---- */
.main-headline {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-primary);
  line-height: 1.25;
  margin-bottom: 16px;
}

.highlight {
  color: var(--accent-blue);
}

/* ---- Subtitle ---- */
.subtitle {
  font-size: 15px;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ---- Form ---- */
form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Input Group (matches Policy Generator input-group) ---- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

.text-input {
  width: 100%;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-dark);
  transition: all 0.2s ease;
  background: var(--white);
}

.text-input::placeholder {
  color: var(--text-light);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* ---- Input Row (side by side on desktop) ---- */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Star Rating ---- */
.rating-section {
  margin-top: 4px;
}

.stars-container {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.star-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  font-size: 18px;
  color: var(--star-off);
  transition: all 0.15s ease;
  position: relative;
}

.star-btn:hover {
  border-color: var(--star-hover);
  background: #FFFBEB;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.star-btn.active {
  border-color: var(--star-on);
  background: #FEF3C7;
  color: var(--star-on);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.star-btn .star-number {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-light);
  opacity: 0;
  transition: opacity 0.15s;
}

.star-btn:hover .star-number,
.star-btn.active .star-number {
  opacity: 1;
}

.rating-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* ---- Submit Button (matches Policy Generator btn-primary) ---- */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  border-radius: 10px;
  padding: 16px 24px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--navy-primary);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.btn-primary.success {
  background: #059669;
}

/* ---- Status Message ---- */
.status {
  min-height: 20px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.status.error {
  color: #DC2626;
}

.status.success {
  color: #059669;
}

/* ---- Trust Info (matches Policy Generator trust-microcopy) ---- */
.trust-info {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---- Footer (matches Policy Generator footer-simple) ---- */
.footer-simple {
  margin-top: 16px;
  text-align: center;
}

.footer-simple p {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

/* ---- Success State (animated) ---- */
.success-overlay {
  position: absolute;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  animation: fadeInUp 0.4s ease-out;
}

.success-icon-wrapper {
  width: 80px;
  height: 80px;
  background: #DCFCE7;
  color: #166534;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 0 0 8px #F0FDF4;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.success-overlay h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy-primary);
  margin-bottom: 8px;
}

.success-overlay p {
  font-size: 15px;
  color: var(--text-gray);
  line-height: 1.5;
}

.btn-reset {
  margin-top: 24px;
  background: transparent;
  border: 2px solid var(--border-light);
  color: var(--text-gray);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-reset:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: #EFF6FF;
}

/* ---- Responsive (Mobile) ---- */
@media (max-width: 640px) {
  .page-shell {
    padding: 0;
    align-items: stretch;
  }

  .feedback-container {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .welcome-header {
    padding: 16px;
  }

  .welcome-content {
    padding: 24px 20px;
  }

  .main-headline {
    font-size: 22px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .stars-container {
    grid-template-columns: repeat(5, 1fr);
  }

  .star-btn {
    font-size: 20px;
  }
}
