/* =============================================
   TUKOO — style.css
   Responsivo: mobile-first, funciona em
   320px até desktop wide
   ============================================= */

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

:root {
  --azul:      #2744a3;
  --azul-dark: #1d3490;
  --azul-light:#3a5ac9;
  --amarelo:   #f4b703;
  --branco:    #ffffff;
  --cinza-bg:  #f5f7fc;
  --cinza-brd: #dde3f0;
  --cinza-txt: #7a8ab0;
  --radius-card: 16px;
  --radius-btn:  50%;
  --sombra: 0 8px 40px rgba(39, 68, 163, 0.18);
}

html { font-size: 16px; }

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--azul);
  /* gradiente sutil para dar profundidade */
  background-image: radial-gradient(ellipse at 60% 0%, #3a5ac9 0%, #2744a3 50%, #1d3490 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* =============================================
   CONTAINER PRINCIPAL
   ============================================= */
.page {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 28px;
  padding: 40px 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--sombra);
}

/* =============================================
   HEADER
   ============================================= */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--branco);
}

.logo-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--branco);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.2);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.app-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  line-height: 1.3;
}

.app-sub {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.75;
  text-align: center;
}

/* Ícones sociais */
.socials {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.soc-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--branco);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.soc-btn:hover  { background: rgba(255,255,255,0.28); transform: translateY(-2px); }
.soc-btn:active { transform: scale(0.94); }
.soc-btn svg    { width: 17px; height: 17px; }

/* =============================================
   CARDS
   ============================================= */
.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--branco);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--azul);
  border: 1.5px solid transparent;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card:hover  { background: #eef1fb; transform: translateY(-2px); }
.card:active { transform: scale(0.98); }

.card--primary {
  border-color: var(--azul);
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--cinza-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.card-icon img  { width: 36px; height: 36px; object-fit: contain; }
.card-icon--green { background: #dcfce7; }

.card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--azul);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  font-size: 11px;
  color: var(--cinza-txt);
  font-weight: 400;
}

.btn-dots {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--cinza-txt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.btn-dots:hover  { background: var(--cinza-bg); border-color: var(--cinza-brd); }
.btn-dots:active { transform: scale(0.92); }
.btn-dots svg    { width: 18px; height: 18px; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  text-align: center;
}
.footer a {
  color: var(--amarelo);
  text-decoration: none;
  font-weight: 600;
}
.footer a:hover { text-decoration: underline; }

/* =============================================
   MODAL DE PARTILHA
   ============================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--branco);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 440px;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.overlay.show .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: #e0e0e0;
  margin: 12px auto 18px;
}

.modal-title {
  font-size: 12px;
  font-weight: 700;
  color: #aaa;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.modal-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 18px;
  background: var(--cinza-bg);
  border-radius: 14px;
  padding: 12px 14px;
}

.modal-preview-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--azul);
  color: var(--amarelo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.modal-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--azul);
}
.modal-preview-url {
  font-size: 11px;
  color: var(--cinza-txt);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Grid de partilha */
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 0 12px 14px;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Montserrat', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.share-item:hover  { background: var(--cinza-bg); }
.share-item:active { transform: scale(0.94); }

.share-item span {
  font-size: 10px;
  color: #555;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.share-ico {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-ico svg { width: 26px; height: 26px; }

.share-ico--green  { background: #dcfce7; }
.share-ico--blue   { background: #dbeafe; }
.share-ico--indigo { background: #e0e7ff; }
.share-ico--gray   { background: #f3f4f6; }
.share-ico--yellow { background: #fef9c3; }
.share-ico--pink   { background: #fce7f3; }

.modal-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 20px 16px;
}

/* Linha copiar link */
.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px;
  background: var(--cinza-bg);
  border-radius: 14px;
  padding: 10px 14px;
}

.copy-url {
  flex: 1;
  font-size: 12px;
  font-family: monospace;
  color: var(--azul);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  background: var(--azul);
  color: var(--branco);
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover  { background: var(--azul-dark); }
.copy-btn:active { transform: scale(0.96); }
.copy-btn.copiado { background: #16a34a; }

/* =============================================
   RESPONSIVIDADE
   ============================================= */

/* Telemóveis muito pequenos (< 360px) */
@media (max-width: 359px) {
  body { padding: 12px 10px; }
  .page { padding: 28px 16px; gap: 20px; border-radius: 20px; }
  .app-name { font-size: 15px; }
  .card-label { font-size: 13px; }
  .share-grid { grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 0 8px 12px; }
  .share-ico { width: 42px; height: 42px; }
  .share-ico svg { width: 22px; height: 22px; }
  .share-item span { font-size: 9px; }
}

/* Telemóveis standard (360–480px) — já cobre a maioria */
@media (min-width: 360px) and (max-width: 480px) {
  body { padding: 16px 12px; }
  .page { padding: 32px 20px; }
}

/* Tablets e ecrãs médios (481–767px) */
@media (min-width: 481px) and (max-width: 767px) {
  body { padding: 32px 24px; }
  .page { max-width: 480px; }
}

/* Tablets e desktop (≥ 768px) */
@media (min-width: 768px) {
  body { padding: 40px; }
  .page { max-width: 460px; padding: 48px 40px; gap: 32px; }
  .logo-ring { width: 100px; height: 100px; }
  .app-name { font-size: 19px; }
  .card { padding: 16px 18px; }
  .card-icon { width: 52px; height: 52px; }
  .card-icon img { width: 38px; height: 38px; }
  .card-label { font-size: 15px; }
  .modal { max-width: 460px; }
  .share-ico { width: 54px; height: 54px; }
  .share-ico svg { width: 28px; height: 28px; }
  .share-item span { font-size: 11px; }
}

/* Landscape em telemóveis */
@media (max-height: 600px) and (orientation: landscape) {
  body { align-items: flex-start; padding: 16px; }
  .page { gap: 16px; padding: 24px 20px; }
  .logo-ring { width: 70px; height: 70px; }
  .app-name { font-size: 15px; }
  .modal { max-height: 80vh; overflow-y: auto; }
}
