@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --airbus-blue: #00205b;
  --airbus-blue-soft: #173e7f;
  --content-width: 1140px;
  --header-height: 70px;
  --surface: #ffffff;
  --page-bg: #f4f7fb;
  --text: #344054;
  --muted: #667085;
  --line: #d9e0ea;
  --focus: #6aa8ff;
  --score-red: #d93a32;
  --score-orange: #f28c28;
  --score-green: #218c5a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
}

.airbus-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  min-height: var(--header-height);
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--airbus-blue);
  color: #ffffff;
}

.header-inner {
  width: min(100%, var(--content-width));
  min-height: calc(var(--header-height) - 20px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 20px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: 106px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.78);
}

.application-name {
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
}

/* User menu (FO + BO) */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 4px 4px;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 160ms ease;
  white-space: nowrap;
}

.user-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #d8e0ea;
  color: #173e7f;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.user-avatar-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #21c463;
  border: 2px solid var(--airbus-blue);
  box-sizing: border-box;
}

.user-menu-label {
  font-weight: 400;
}

.user-menu-trigger:hover,
.user-menu:focus-within .user-menu-trigger,
.user-menu.is-open .user-menu-trigger {
  background: rgba(255, 255, 255, 0.08);
}

.user-menu-trigger:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.user-menu-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 160ms ease;
}

.user-menu:hover .user-menu-chevron,
.user-menu:focus-within .user-menu-chevron,
.user-menu.is-open .user-menu-chevron {
  opacity: 1;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(0, 32, 91, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
  z-index: 50;
}

/* invisible bridge so the dropdown stays open while the cursor moves */
.user-menu-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown,
.user-menu.is-open .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: #f4f7fb;
  color: var(--airbus-blue);
}

.user-menu-item:focus-visible {
  outline: 2px solid var(--airbus-blue-soft);
  outline-offset: 0;
}

.user-menu-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.feedback-main {
  width: 100%;
  flex: 1;
  padding: clamp(24px, 3vw, 30px) clamp(24px, 3vw, 30px);
}

.feedback-panel {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--airbus-blue);
  border-radius: 3px;
  box-shadow: 0 18px 42px rgba(0, 32, 91, 0.09);
}

.feedback-panel[hidden] {
  display: none;
}

/* Loading + Error state panels */
.feedback-panel--state {
  border-top-color: var(--airbus-blue);
}

.feedback-panel--error {
  border-top-color: var(--score-red);
}

.state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: clamp(40px, 6vw, 64px) clamp(24px, 3vw, 30px);
}

.state-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  border-top-color: var(--airbus-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
}

.state-icon svg {
  width: 38px;
  height: 38px;
}

.state-icon--error {
  background: #fdecea;
  color: var(--score-red);
}

.state-title {
  margin: 0;
  font-size: clamp(1.4rem, 1.6vw, 1.7rem);
  font-weight: 700;
  color: var(--airbus-blue);
}

.feedback-panel--error .state-title {
  color: var(--score-red);
}

.state-message {
  max-width: 540px;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.state-help {
  max-width: 540px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

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

@media (prefers-reduced-motion: reduce) {
  .state-spinner {
    animation: none;
    border-top-color: var(--airbus-blue-soft);
  }
}

.feedback-heading {
  padding: clamp(24px, 3vw, 30px) clamp(24px, 3vw, 30px) 24px;
  border-bottom: 1px solid var(--line);
}

.feedback-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 6px 10px;
  border-radius: 3px;
  background: #eaf0f8;
  color: var(--airbus-blue);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.feedback-meta[hidden] {
  display: none;
}

h1 {
  margin: 0;
  color: var(--airbus-blue);
  font-size: clamp(1.58rem, 2vw, 2rem);
  line-height: 1.08;
  font-weight: 700;
}

.project-title {
  max-width: 840px;
  margin: 0;
  color: #344054;
  font-size: clamp(0.98rem, 0.8vw + 0.84rem, 1.18rem);
  line-height: 1.4;
  font-weight: 500;
}

.feedback-form {
  padding: 0 clamp(24px, 3vw, 30px) clamp(24px, 3vw, 30px);
}

.rating-field {
  margin: 0;
  padding: clamp(30px, 2vw, 20px) 0 clamp(32px, 2vw, 20px);
  border: 0;
  border-bottom: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.rating-header {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
}

.question-title {
  color: var(--text);
  font-size: clamp(1rem, 0.55vw + 0.9rem, 1.15rem);
  line-height: 1.25;
  font-weight: 600;
}

.selected-value {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.rating-field.has-error .selected-value {
  color: var(--score-red);
}

.rating-scale {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(48px, 1fr));
  gap: 10px;
}

.score-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 5px;
  padding: 0;
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.score-button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 180ms ease, transform 360ms ease;
}

.score-button:hover::after {
  opacity: 1;
  transform: translateX(100%);
}

.score-button:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 20px rgba(0, 32, 91, 0.18);
  transform: translateY(-3px);
}

.score-button:active {
  transform: translateY(-1px) scale(0.98);
}

.score-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.score-button--red {
  background: var(--score-red);
}

.score-button--orange {
  background: var(--score-orange);
}

.score-button--green {
  background: var(--score-green);
}

.score-button.is-selected {
  background: var(--airbus-blue);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 32, 91, 0.22), 0 12px 24px rgba(0, 32, 91, 0.22);
  transform: translateY(-4px) scale(1.03);
  animation: selectedPulse 260ms ease-out;
}

.comment-field {
  display: grid;
  gap: 10px;
  padding: clamp(30px, 2vw, 20px) 0 0;
  color: var(--text);
  font-size: clamp(1rem, 0.55vw + 0.9rem, 1.15rem);
  font-weight: 600;
}

.comment-field textarea {
  width: 100%;
  min-height: 115px;
  resize: vertical;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  padding: 14px 16px;
  color: var(--text);
  background: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 400;
}

.comment-field textarea:focus {
  border-color: var(--airbus-blue-soft);
  outline: 3px solid rgba(106, 168, 255, 0.28);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 24px;
}

.form-message {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #a7dec0;
  border-left: 4px solid var(--score-green);
  border-radius: 3px;
  background: #e8f7ef;
  color: #17603e;
  font-size: 0.94rem;
  font-weight: 700;
  animation: messageIn 220ms ease-out;
}

.form-message[hidden] {
  display: none;
}

.button {
  min-height: 42px;
  min-width: 120px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.button-primary {
  background: var(--airbus-blue);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--airbus-blue-soft);
}

.button-secondary {
  border-color: #a7b4c7;
  background: #ffffff;
  color: var(--airbus-blue);
}

.button-secondary:hover {
  background: #f0f4fa;
}

.airbus-footer {
  padding: 24px clamp(16px, 4vw, 40px);
  background: var(--airbus-blue);
  color: #ffffff;
}

.footer-inner {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.footer-links {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(24px, 5vw, 64px);
}

.footer-links a {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 160ms ease;
}

.footer-links a:hover {
  opacity: 0.78;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
  font-size: 0.9rem;
  white-space: nowrap;
}

.footer-brand img {
  width: 92px;
  height: auto;
  display: block;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 3px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #9f1d17;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  left: var(--confetti-x);
  width: var(--confetti-width);
  height: var(--confetti-height);
  border-radius: var(--confetti-radius);
  background: var(--confetti-color);
  opacity: 0.95;
  transform: translate3d(0, 0, 0) rotate(var(--confetti-rotation));
  animation: confettiFall var(--confetti-duration) cubic-bezier(0.22, 0.82, 0.38, 1) forwards;
  animation-delay: var(--confetti-delay);
}

@keyframes selectedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 32, 91, 0.34), 0 10px 20px rgba(0, 32, 91, 0.16);
  }

  100% {
    box-shadow: 0 0 0 2px rgba(0, 32, 91, 0.22), 0 12px 24px rgba(0, 32, 91, 0.22);
  }
}

@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -24px, 0) rotate(var(--confetti-rotation));
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-drift), 110vh, 0) rotate(var(--confetti-spin));
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece {
    display: none;
  }
}

@media (max-width: 780px) {
  :root {
    --header-height: 70px;
  }

  .airbus-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header-inner {
    min-height: calc(var(--header-height) - 16px);
    align-items: center;
    flex-direction: row;
    gap: 12px;
  }

  .brand-lockup {
    flex: 0 1 auto;
    gap: 12px;
  }

  .brand-logo {
    width: 92px;
  }

  .brand-divider {
    height: 24px;
  }

  .application-name {
    font-size: 16px;
  }

  .rating-scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .rating-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .footer-inner {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
  }

  .footer-links {
    flex: 0 1 auto;
    min-width: 0;
    gap: 12px;
  }

  .footer-links a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .footer-links a,
  .footer-brand {
    font-size: 0.72rem;
  }

  .footer-brand {
    flex: 0 0 auto;
    gap: 8px;
  }

  .footer-brand img {
    width: 56px;
  }
}

@media (max-width: 460px) {
  .brand-lockup {
    gap: 10px;
  }

  .brand-logo {
    width: 84px;
  }

  .brand-divider {
    height: 22px;
  }

  .rating-scale {
    gap: 8px;
  }

  .score-button {
    min-height: 50px;
  }

  .airbus-footer {
    padding: 16px 10px;
  }

  .footer-inner {
    gap: 8px;
  }

  .footer-links {
    gap: 8px;
  }

  .footer-links a,
  .footer-brand {
    font-size: 0.58rem;
  }

  .footer-brand {
    gap: 6px;
  }

  .footer-brand img {
    width: 42px;
  }
}
