* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  background: #1e3c9b;
}

.top-bar {
  height: 25px;
  background: #050505;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 32.5%;
}

.language-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 100%;
}

.language-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.language-nav a:hover,
.language-nav a:focus {
  opacity: 0.7;
}

.country-page {
  min-height: calc(100vh - 25px);
  background:
    radial-gradient(circle at 72% 28%, rgba(86, 196, 238, 0.78) 0, rgba(86, 196, 238, 0.22) 22%, transparent 48%),
    radial-gradient(circle at 42% 32%, rgba(47, 104, 242, 0.85) 0, rgba(47, 104, 242, 0.22) 40%, transparent 68%),
    linear-gradient(115deg, #172f83 0%, #2449bd 38%, #2c6ee6 67%, #5bd1ed 100%);
  padding-top: 48px;
  overflow: hidden;
}

.country-card {
  width: 535px;
  max-width: calc(100% - 40px);
  margin: 0 auto;
}

.brand {
  width: 80px;
  margin-bottom: 18px;
  color: #fff;
  font-size: 25px;
  line-height: 21px;
  font-weight: 900;
  letter-spacing: -1.7px;
}

.brand span {
  display: block;
}

.brand-dot {
  display: inline !important;
  color: #ffe900;
  margin-left: 1px;
}

h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.1;
  letter-spacing: -2.2px;
  font-weight: 800;
}

.country-options {
  display: flex;
  justify-content: center;
  gap: 67px;
  margin-top: 22px;
  padding-bottom: 31px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.country-option {
  width: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.country-option:hover .flag,
.country-option:focus-visible .flag {
  transform: translateY(-3px);
}

.flag {
  width: 165px;
  height: 84px;
  display: block;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Canada */
.flag-canada {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      90deg,
      #d9231e 0 25%,
      #fff 25% 75%,
      #d9231e 75% 100%
    );
}

.maple-leaf {
  color: #d9231e;
  font-size: 51px;
  line-height: 1;
  transform: scaleX(0.82);
}

/* USA */
.flag-usa {
  background:
    linear-gradient(
      to bottom,
      #b22234 0 7.69%,
      #fff 7.69% 15.38%,
      #b22234 15.38% 23.07%,
      #fff 23.07% 30.76%,
      #b22234 30.76% 38.45%,
      #fff 38.45% 46.14%,
      #b22234 46.14% 53.83%,
      #fff 53.83% 61.52%,
      #b22234 61.52% 69.21%,
      #fff 69.21% 76.90%,
      #b22234 76.90% 84.59%,
      #fff 84.59% 92.28%,
      #b22234 92.28% 100%
    );
}

.flag-usa::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  height: 54%;
  background: #3c3b6e;
}

.flag-usa::after {
  content: "••••••••••••••••••••••••";
  position: absolute;
  top: 4px;
  left: 8px;
  width: 105px;
  height: 35px;
  color: #fff;
  font-size: 8px;
  line-height: 8px;
  letter-spacing: 2px;
  overflow: hidden;
}

.info {
  padding-top: 30px;
}

.info h2 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
}

.info p {
  margin: 0;
  max-width: 525px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
}

.info a {
  color: #fff;
}

.details-link {
  white-space: nowrap;
  text-decoration: none;
}

.details-link:hover,
.details-link:focus-visible {
  text-decoration: underline;
}

.details-link span {
  font-size: 20px;
  line-height: 0;
  vertical-align: -2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Tablet */
@media (max-width: 900px) {
  .top-bar {
    padding: 0 24px;
  }

  .country-page {
    padding-top: 40px;
  }

  .country-card {
    width: 620px;
  }

  h1 {
    font-size: 50px;
  }

  .country-options {
    gap: 55px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .top-bar {
    height: 34px;
    justify-content: center;
    padding: 0 12px;
  }

  .language-nav {
    gap: 18px;
  }

  .language-nav a {
    font-size: 11px;
  }

  .country-page {
    min-height: calc(100vh - 34px);
    padding: 34px 20px 50px;
    background:
      radial-gradient(circle at 75% 12%, rgba(80, 190, 237, 0.75), transparent 38%),
      linear-gradient(150deg, #19368f 0%, #2859ca 52%, #3fa7df 100%);
  }

  .country-card {
    width: 100%;
    max-width: 440px;
  }

  .brand {
    width: 70px;
    margin-bottom: 18px;
    font-size: 22px;
    line-height: 19px;
  }

  h1 {
    font-size: clamp(40px, 12vw, 52px);
    line-height: 1.04;
    letter-spacing: -1.5px;
  }

  .country-options {
    gap: 20px;
    margin-top: 28px;
    padding-bottom: 26px;
  }

  .country-option {
    width: min(42vw, 165px);
    font-size: 13px;
  }

  .flag {
    width: 100%;
    height: auto;
    aspect-ratio: 1.96 / 1;
  }

  .maple-leaf {
    font-size: 42px;
  }

  .info {
    padding-top: 25px;
  }

  .info h2 {
    font-size: 15px;
  }

  .info p {
    font-size: 14px;
    line-height: 1.55;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .country-options {
    gap: 14px;
  }

  .country-option {
    font-size: 12px;
  }

  h1 {
    font-size: 38px;
  }

  .info p {
    font-size: 13px;
  }
}
