/* ==========================================================
   GlobPay - Pantalla de Selección de País (Paso 1 de 7)
   Sistema de Diseño Oficial: Proporciones, Sombras y Jerarquía
   ========================================================== */

@import "brand.css";

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--globpay-bg-neutral);
  color: var(--globpay-black);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 16px 20px 16px;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor Principal */
.country-selector-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Encabezado */
.brand-logo-wrap {
  margin-bottom: 16px;
}

.brand-logo-img {
  width: 130px;
  height: auto;
  aspect-ratio: 1024 / 853;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.step-indicator {
  font-size: 13px;
  font-weight: 500;
  color: var(--globpay-gray-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.country-page-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--globpay-black);
  letter-spacing: -0.8px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.country-page-subtitle {
  font-size: 15px;
  color: var(--globpay-gray-secondary);
  font-weight: 400;
  margin-bottom: 24px;
}

/* Cuadrícula de Países */
.countries-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin-bottom: 20px;
}

.countries-row-1 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

.countries-row-2 {
  display: flex;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.countries-row-2 .country-card {
  width: calc((100% - 42px) / 4);
}

/* Tarjeta de País */
.country-card {
  background: var(--globpay-white);
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  padding: 16px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  user-select: none;
  outline: none;
}

.country-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.country-card:focus-visible {
  box-shadow: 0 0 0 3px var(--globpay-focus-ring);
}

/* Tarjeta Seleccionada (Panamá) */
.country-card.is-selected {
  border-color: #00D5D4;
  border-width: 2px;
  background: #F0FBFB;
  box-shadow: 0 8px 24px rgba(11, 182, 181, 0.22), 0 2px 6px rgba(11, 182, 181, 0.1);
  transform: translateY(-1px);
}

.country-check-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00D5D4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 213, 212, 0.4);
}

/* Banderas */
.flag-wrap {
  width: 78px;
  height: 78px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.country-card:hover .flag-wrap {
  transform: scale(1.04);
}

.flag-badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Países no activos: efecto atenuado */
.country-card.is-disabled .flag-badge-img {
  filter: grayscale(18%) opacity(88%);
}

.country-card.is-disabled:hover .flag-badge-img {
  filter: grayscale(0%) opacity(100%);
}

.country-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--globpay-black);
  text-align: center;
  letter-spacing: -0.2px;
}

.country-card.is-disabled .country-name {
  color: #374151;
}

/* Nota Informativa debajo de la Cuadrícula */
.country-info-note {
  font-size: 12.5px;
  color: var(--globpay-gray-secondary);
  margin-bottom: 16px;
  font-weight: 400;
}

/* Botón Principal */
.btn-continue-wrap {
  margin-bottom: 12px;
}

.btn-continue-country {
  background: #00C7C7;
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 12px 34px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 199, 199, 0.38), 0 2px 6px rgba(0, 199, 199, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-continue-country:hover {
  background: #00b3b3;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 199, 199, 0.45);
}

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

.btn-continue-country:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--globpay-focus-ring);
}

/* Pie de Página */
.country-footer {
  font-size: 12.5px;
  color: var(--globpay-gray-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.support-link {
  color: #00B6B5;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Mensaje de Confirmación / Estado Guardado */
.save-confirmation-card {
  display: none;
  background: #FFFFFF;
  border: 1.5px solid #00D5D4;
  border-radius: 14px;
  padding: 20px 24px;
  max-width: 540px;
  width: 90%;
  margin: 16px auto;
  text-align: center;
  box-shadow: 0 10px 25px rgba(11, 182, 181, 0.15);
  animation: fadeIn 0.25s ease;
}

.save-confirmation-card.active {
  display: block;
}

.save-confirmation-icon {
  font-size: 26px;
  color: #0BB6B5;
  margin-bottom: 8px;
}

.save-confirmation-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--globpay-black);
  margin-bottom: 6px;
}

.save-confirmation-text {
  font-size: 13.5px;
  color: var(--globpay-gray-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
}

.dev-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--globpay-bg-neutral);
  border: 1px solid #E5E7EB;
  color: var(--globpay-black);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.dev-panel-link:hover {
  background: #E5E7EB;
}

/* ==========================================================
   VISTA PANTALLAS "PRÓXIMAMENTE"
   ========================================================== */
.view-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.view-container.is-hidden {
  display: none !important;
}

.coming-soon-card {
  background: var(--globpay-white);
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 20px auto;
  animation: fadeIn 0.25s ease;
}

.coming-soon-flag-wrap {
  width: 110px;
  height: 110px;
  margin-bottom: 20px;
}

.coming-soon-flag-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.coming-soon-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--globpay-black);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.coming-soon-text {
  font-size: 14.5px;
  color: var(--globpay-gray-secondary);
  line-height: 1.5;
  max-width: 440px;
  margin-bottom: 24px;
}

.coming-soon-date-badge {
  background: #F0FBFB;
  border: 1px solid #9BE5E4;
  color: #087877;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 9999px;
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-back-countries {
  background: var(--globpay-black);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 12px 28px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-back-countries:hover {
  background: #262626;
  transform: translateY(-1px);
}

.btn-back-countries:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--globpay-focus-ring);
}

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

/* ==========================================================
   RESPONSIVE DESIGN (360px, 390px, 430px, tablets)
   ========================================================== */
@media (max-width: 768px) {
  body {
    padding: 24px 12px 20px 12px;
  }

  .country-page-title {
    font-size: 27px;
  }

  .country-page-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .countries-row-1 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .countries-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .countries-row-2 .country-card {
    width: 100%;
  }

  /* El séptimo país (República Dominicana) abarca 2 columnas centradas en mobile */
  .countries-row-2 .country-card:last-child {
    grid-column: span 2;
    max-width: 220px;
    margin: 0 auto;
    width: 100%;
  }

  .flag-wrap {
    width: 76px;
    height: 76px;
    margin-bottom: 10px;
  }

  .country-card {
    padding: 16px 10px 14px 10px;
    border-radius: 14px;
  }

  .country-name {
    font-size: 13.5px;
  }

  .coming-soon-card {
    padding: 30px 20px;
  }

  .coming-soon-title {
    font-size: 22px;
  }

  .btn-continue-country {
    width: 100%;
    max-width: 320px;
    padding: 14px 20px;
  }
}

@media (max-width: 380px) {
  .country-page-title {
    font-size: 23px;
  }

  .flag-wrap {
    width: 68px;
    height: 68px;
  }

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