/* ==========================================================================
   Earnest Immigration Review Portal
   Hand-ported from the original Tailwind build; values match Tailwind's
   defaults so the rendered result is visually identical.
   ========================================================================== */

:root {
  --brand: #492383;
  --brand-light: #6b2fb5;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --green-600: #16a34a;
  --red-100: #fee2e2;
  --red-700: #b91c1c;

  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* --- Reset (Tailwind preflight, trimmed to what this page uses) ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--gray-200);
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  scroll-behavior: smooth;
}

body {
  margin: 0;
  line-height: inherit;
  background-color: var(--gray-50);
}

h1, h2, h3, p, address, figure {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

address { font-style: normal; }

a { color: inherit; text-decoration: inherit; }

button,
input,
textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button {
  background-color: transparent;
  background-image: none;
  text-transform: none;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; }

svg { display: block; vertical-align: middle; }

img {
  display: block;
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

[hidden] { display: none !important; }

/* --- Shared icon sizes -------------------------------------------------- */

.icon-5 { width: 1.25rem; height: 1.25rem; }
.icon-6 { width: 1.5rem; height: 1.5rem; }
.shrink-0 { flex-shrink: 0; }

.spin { animation: spin 1s linear infinite; }

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

.only-mobile { display: inline; }
.only-desktop { display: none; }

@media (min-width: 768px) {
  .only-mobile { display: none; }
  .only-desktop { display: inline; }
}

/* --- Layout ------------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(to bottom right, var(--gray-50), var(--gray-100));
}

.app-main { flex: 1 1 0%; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  background-color: var(--brand);
  box-shadow: var(--shadow-lg);
}

.site-header__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header__logo {
  height: 3rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .site-header__inner { padding: 1.5rem 1rem; }
  .site-header__logo { height: 4rem; }
}

@media (min-width: 1024px) {
  .site-header__logo { height: 5rem; }
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

.hero__head {
  text-align: center;
  margin-bottom: 2rem;
}

.hero__title {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.hero__sub {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--gray-600);
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.services { margin-bottom: 2rem; }

.services__title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  text-align: center;
}

.services__sub {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  text-align: center;
  padding: 0 1rem;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .hero { padding: 4rem 1rem; }
  .hero__head { margin-bottom: 3rem; }
  .hero__title { font-size: 2.25rem; line-height: 2.5rem; margin-bottom: 1rem; }
  .hero__sub { font-size: 1.25rem; line-height: 1.75rem; }
  .services { margin-bottom: 3rem; }
  .services__title { font-size: 1.5rem; line-height: 2rem; margin-bottom: 1.5rem; }
  .services__sub { font-size: 1rem; line-height: 1.5rem; margin-bottom: 2rem; }
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (min-width: 1024px) {
  .hero__title { font-size: 3rem; line-height: 1; }
  .services__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Service card ------------------------------------------------------- */

.service-card__form { display: flex; }

.service-card {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  transition: box-shadow 300ms, transform 300ms;
}

.service-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-0.25rem);
}

.service-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.service-card__icon {
  padding: 1rem;
  background-image: linear-gradient(to bottom right, var(--brand), var(--brand-light));
  border-radius: 0.75rem;
  color: #fff;
  transition: transform 300ms;
}

.service-card:hover .service-card__icon { transform: scale(1.1); }

.icon-service { width: 2rem; height: 2rem; }

.service-card__title {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--gray-800);
  transition: color 150ms;
}

.service-card:hover .service-card__title { color: var(--brand); }

.service-card__cta {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: gap 150ms;
}

.service-card:hover .service-card__cta { gap: 0.75rem; }

.icon-arrow {
  width: 1rem;
  height: 1rem;
  transition: transform 150ms;
}

.service-card:hover .icon-arrow { transform: translateX(0.25rem); }

@media (min-width: 768px) {
  .service-card { padding: 2rem; }
  .service-card__icon { padding: 1.25rem; }
  .icon-service { width: 2.5rem; height: 2.5rem; }
  .service-card__title { font-size: 1.125rem; line-height: 1.75rem; }
  .service-card__cta { font-size: 1rem; line-height: 1.5rem; }
  .icon-arrow { width: 1.25rem; height: 1.25rem; }
}

/* --- Improve your review ------------------------------------------------ */

.improve {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

.improve__card {
  background-image: linear-gradient(to bottom right, var(--brand), var(--brand-light));
  border-radius: 1rem;
  box-shadow: var(--shadow-2xl);
  padding: 1.5rem;
  color: #fff;
}

.improve__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.improve__icon {
  padding: 0.5rem;
  background-color: rgb(255 255 255 / 0.2);
  border-radius: 0.5rem;
  backdrop-filter: blur(4px);
}

.icon-improve { width: 1.5rem; height: 1.5rem; }

.improve__title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.improve__lead {
  color: rgb(255 255 255 / 0.9);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.improve__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.improve__label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.improve__textarea {
  width: 100%;
  height: 7rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.5rem;
  background-color: rgb(255 255 255 / 0.1);
  backdrop-filter: blur(4px);
  border: 2px solid rgb(255 255 255 / 0.2);
  color: #fff;
  resize: none;
  transition: border-color 150ms;
}

.improve__textarea::placeholder { color: rgb(255 255 255 / 0.5); }

.improve__textarea:focus {
  outline: none;
  border-color: rgb(255 255 255 / 0.4);
}

.improve__hint {
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(255 255 255 / 0.7);
  margin-top: 0.5rem;
}

.improve__error {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #fff;
  background-color: rgb(0 0 0 / 0.2);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
}

.improve__button {
  width: 100%;
  background-color: #fff;
  color: var(--brand);
  font-weight: 600;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  transition: background-color 300ms, box-shadow 300ms, opacity 300ms;
}

.improve__button:hover:not(:disabled) {
  background-color: var(--gray-50);
  box-shadow: var(--shadow-xl);
}

.improve__button:disabled { opacity: 0.5; }

.improve__button-idle,
.improve__button-busy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.improve__button-busy { display: none; }

.improve__button.is-busy .improve__button-idle { display: none; }
.improve__button.is-busy .improve__button-busy { display: flex; }

@media (min-width: 768px) {
  .improve { padding: 4rem 1rem; }
  .improve__card { padding: 3rem; border-radius: 1rem; }
  .improve__head { gap: 0.75rem; margin-bottom: 1.5rem; }
  .improve__icon { padding: 0.75rem; }
  .icon-improve { width: 2rem; height: 2rem; }
  .improve__title { font-size: 1.875rem; line-height: 2.25rem; }
  .improve__lead { margin-bottom: 2rem; font-size: 1.125rem; line-height: 1.75rem; }
  .improve__form { gap: 1.5rem; }
  .improve__label { margin-bottom: 0.75rem; }
  .improve__textarea { height: 8rem; padding: 0.75rem 1rem; font-size: 1rem; line-height: 1.5rem; }
  .improve__hint { font-size: 0.875rem; line-height: 1.25rem; }
  .improve__button { padding: 1rem 1.5rem; font-size: 1rem; line-height: 1.5rem; }
}

/* --- Generated reviews screen ------------------------------------------- */

.reviews {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
}

.reviews__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand);
  margin-bottom: 1.5rem;
  transition: color 150ms;
}

.reviews__back:hover { color: var(--brand-light); }

.reviews__back svg { transition: transform 150ms; }
.reviews__back:hover svg { transform: translateX(-0.25rem); }

.reviews__back-label {
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.reviews__head {
  text-align: center;
  margin-bottom: 2rem;
}

.reviews__title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.reviews__sub {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-600);
  padding: 0 1rem;
}

.reviews__grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .reviews { padding: 3rem 1rem; }
  .reviews__back { margin-bottom: 2rem; }
  .reviews__back-label { font-size: 1rem; line-height: 1.5rem; }
  .reviews__head { margin-bottom: 3rem; }
  .reviews__title { font-size: 1.875rem; line-height: 2.25rem; margin-bottom: 0.75rem; }
  .reviews__sub { font-size: 1rem; line-height: 1.5rem; }
  .reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

/* --- Review card -------------------------------------------------------- */

.review-card {
  display: block;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: box-shadow 300ms, transform 300ms;
  cursor: pointer;
}

.review-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-0.25rem);
}

.review-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.review-card__status {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.75rem;
  color: var(--gray-400);
  transition: color 150ms;
}

.review-card:hover .review-card__status { color: var(--brand); }

.icon-copy,
.icon-check { width: 1rem; height: 1rem; }

.review-card__status-done { display: none; color: var(--green-600); }

.review-card.is-copied .review-card__status-idle { display: none; }
.review-card.is-copied .review-card__status-done { display: block; }

.review-card__body {
  display: block;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--gray-700);
  padding-right: 2rem;
  white-space: pre-wrap;
}

.review-card__foot {
  display: block;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

.review-card__cta {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--brand);
  font-weight: 500;
}

.review-card:hover .review-card__cta { text-decoration: underline; }

@media (min-width: 768px) {
  .review-card { padding: 1.5rem; }
  .review-card__status { padding: 1rem; }
  .icon-copy,
  .icon-check { width: 1.25rem; height: 1.25rem; }
  .review-card__body { font-size: 1rem; line-height: 1.625; }
  .review-card__foot { margin-top: 1rem; padding-top: 1rem; }
  .review-card__cta { font-size: 0.875rem; line-height: 1.25rem; }
}

/* --- Loading ------------------------------------------------------------ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.icon-spinner {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--brand);
  margin-bottom: 1rem;
}

.loading__text {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-600);
}

@media (min-width: 768px) {
  .loading { padding: 5rem 0; }
  .icon-spinner { width: 3rem; height: 3rem; }
  .loading__text { font-size: 1rem; line-height: 1.5rem; }
}

/* --- Alert -------------------------------------------------------------- */

.alert {
  background-color: var(--red-100);
  color: var(--red-700);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background-color: var(--brand);
  color: #fff;
  margin-top: 5rem;
}

.site-footer__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.site-footer__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.site-footer__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.site-footer__link,
.site-footer__address {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  color: #fff;
  transition: color 150ms;
}

.site-footer__link:hover { color: rgb(255 255 255 / 0.8); }

.site-footer__copy {
  margin-top: 1.5rem;
  text-align: center;
  color: rgb(255 255 255 / 0.7);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

@media (min-width: 768px) {
  .site-footer__inner { padding: 2.5rem 1rem; }
  .site-footer__row { flex-direction: row; gap: 3rem; }
  .site-footer__item { text-align: left; }
  .site-footer__link,
  .site-footer__address { font-size: 1.125rem; line-height: 1.75rem; }
}

/* --- Mobile menu -------------------------------------------------------- */

.mobile-menu { display: block; }

@media (min-width: 768px) {
  .mobile-menu { display: none; }
}

.mobile-menu__toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  background-color: var(--brand);
  color: #fff;
  padding: 0.75rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
  transition: background-color 150ms;
}

.mobile-menu__toggle:hover { background-color: var(--brand-light); }

.mobile-menu__toggle-close { display: none; }

.mobile-menu.is-open .mobile-menu__toggle-open { display: none; }
.mobile-menu.is-open .mobile-menu__toggle-close { display: block; }

.mobile-menu__backdrop {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 0.5);
  z-index: 30;
}

.mobile-menu__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20rem;
  max-width: 85vw;
  background-color: #fff;
  z-index: 40;
  box-shadow: var(--shadow-2xl);
  overflow-y: auto;
}

.mobile-menu__body { padding: 1.5rem 1.5rem 1.5rem; padding-top: 5rem; }

.mobile-menu__heading {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
}

.mobile-menu__stack > * + * { margin-top: 0.75rem; }

.mobile-menu__section {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.mobile-menu__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.mobile-menu__form { display: block; }

.mobile-menu__item {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background-color 150ms;
}

.mobile-menu__item:hover { background-color: rgb(73 35 131 / 0.05); }

.mobile-menu__item-label {
  display: block;
  font-weight: 500;
  color: var(--gray-800);
  transition: color 150ms;
}

.mobile-menu__item:hover .mobile-menu__item-label { color: var(--brand); }

.mobile-menu__cta {
  display: block;
  width: 100%;
  background-image: linear-gradient(to bottom right, var(--brand), var(--brand-light));
  color: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  transition: box-shadow 150ms;
}

.mobile-menu__cta:hover { box-shadow: var(--shadow-lg); }

/* Prevent background scroll while the drawer is open. */
body.menu-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spin { animation-duration: 1s !important; animation-iteration-count: infinite !important; }
}
