/* ============================================================
   Unlock to Copy — glassmorphism dark theme
   Tokens:
   bg      #0a0c10 (near-black, slight blue)
   glass   rgba(255,255,255,.06) / border rgba(255,255,255,.14)
   accent  linear-gradient(135deg,#f87171,#dc2626)  (coral -> deep red)
   success #34d399   danger/lock #fb7185
   type    Sarabun (Thai-safe), weights 400/600/700
   ============================================================ */

.utc-wrapper, .utc-wrapper * { box-sizing: border-box; }

.utc-wrapper {
  --utc-accent-1: #f87171;
  --utc-accent-2: #dc2626;
  --utc-glass: rgba(255,255,255,0.06);
  --utc-glass-strong: rgba(255,255,255,0.10);
  --utc-border: rgba(255,255,255,0.14);
  --utc-text: #eef1f6;
  --utc-text-dim: rgba(238,241,246,0.62);
  --utc-danger: #fb7185;
  --utc-success: #34d399;

  font-family: 'Sarabun', sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
}

.utc-card-shell {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
}

/* ---- notice banner above the card ---- */
.utc-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(16,18,24,0.6);
  border: 1px solid rgba(220,38,38,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: utcBannerGlow 2.5s ease-in-out infinite;
  max-width: 100%;
}
.utc-banner-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--utc-danger);
  animation: utcDotPulse 1.5s infinite;
}
.utc-banner-text {
  display: flex;
  flex-direction: column;
  animation: utcTextFloat 2.8s ease-in-out infinite;
}
.utc-banner-text .utc-en {
  color: var(--utc-text);
  font-size: 13.5px;
  font-weight: 700;
}
.utc-banner-text .utc-th {
  font-size: 11.5px;
  font-weight: 400;
  opacity: 0.65;
  margin-top: 1px;
}
@keyframes utcDotPulse {
  0%   { box-shadow: 0 0 4px rgba(220,38,38,0.5); opacity: 0.7; }
  50%  { box-shadow: 0 0 14px rgba(220,38,38,0.9); opacity: 1; }
  100% { box-shadow: 0 0 4px rgba(220,38,38,0.5); opacity: 0.7; }
}
@keyframes utcBannerGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(220,38,38,0.10); }
  50%       { box-shadow: 0 0 20px rgba(220,38,38,0.28); }
}
@keyframes utcTextFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .utc-banner, .utc-banner-dot, .utc-banner-text { animation: none; }
}

/* ---- ambient aura behind the card: the signature element ---- */
.utc-aura {
  position: absolute;
  width: 420px;
  height: 420px;
  max-width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    rgba(248,113,113,0.35),
    rgba(220,38,38,0.28),
    rgba(248,113,113,0.10),
    rgba(220,38,38,0.28),
    rgba(248,113,113,0.35));
  filter: blur(60px);
  border-radius: 50%;
  z-index: -1;
  animation: utcAuraSpin 14s linear infinite;
}
@keyframes utcAuraSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .utc-aura { animation: none; }
}
@media (max-width: 600px) {
  /* A continuously-rotating background behind a blurred (backdrop-filter)
     card forces WebKit to keep recompositing every frame, which can make
     touches feel unreliable on some iPhones. Keep the aura static on small
     screens — it's decorative, not worth the touch responsiveness cost. */
  .utc-aura { animation: none; }
}

.utc-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 26px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
              rgba(16,18,24,0.55);
  border: 1px solid var(--utc-border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

/* subtle top sheen line for the "glass" read */
.utc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  border-radius: 1px;
}

.utc-label {
  color: var(--utc-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.utc-logo {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--utc-border);
}

.utc-text-box {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--utc-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--utc-text);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 14px;
  word-break: break-all;
  user-select: all;
  filter: blur(6px);
  transition: filter 0.5s ease;
  unicode-bidi: isolate;
}
.utc-text-box.unlocked { filter: none; }

.utc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--utc-border);
  color: var(--utc-text);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease, background 0.3s ease;
  margin-bottom: 12px;
}

.utc-btn-primary {
  background: linear-gradient(135deg, var(--utc-accent-1), var(--utc-accent-2));
  border-color: transparent;
  color: #0a0c10;
  box-shadow: 0 10px 28px rgba(220,38,38,0.28);
}
.utc-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(220,38,38,0.4); }
.utc-btn-primary:active { transform: translateY(0); }

.utc-btn-ghost {
  background: var(--utc-glass);
}
.utc-btn-ghost:hover { background: var(--utc-glass-strong); transform: translateY(-2px); }

.utc-btn[data-utc="copyBtn"] {
  opacity: 0.35;
  pointer-events: none;
}
.utc-btn[data-utc="copyBtn"].active { opacity: 1; pointer-events: auto; }
.utc-btn[data-utc="copyBtn"].copied {
  background: linear-gradient(135deg, var(--utc-success), #10b981);
  color: #06251c;
  box-shadow: 0 10px 28px rgba(52,211,153,0.35);
}

/* ---- lock overlay ---- */
.utc-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,7,10,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.utc-lock-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.utc-lock-chip {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border-radius: 50%;
  background: var(--utc-glass-strong);
  border: 1px solid var(--utc-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.utc-lock-text {
  color: var(--utc-text);
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}
.utc-lock-text span {
  color: var(--utc-text-dim);
  font-weight: 400;
  font-size: 13px;
}
.utc-unlock-btn {
  background: linear-gradient(135deg, var(--utc-accent-1), var(--utc-accent-2));
  border: none;
  border-radius: 12px;
  color: #0a0c10;
  padding: 12px 26px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  font-family: 'Sarabun', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(220,38,38,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.utc-unlock-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(220,38,38,0.42); }

/* ---- popup ---- */
.utc-popup-wrap {
  position: fixed;
  inset: 0;
  background: rgba(6,7,10,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}
.utc-popup-wrap.show { opacity: 1; visibility: visible; }

.utc-popup-box {
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
              rgba(14,16,22,0.75);
  border: 1px solid var(--utc-border);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s ease;
}
.utc-popup-wrap.show .utc-popup-box { transform: translateY(0) scale(1); }

.utc-progress-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--utc-border);
  overflow: hidden;
  margin-bottom: 8px;
}
.utc-progress-fill {
  height: 100%;
  width: 25%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--utc-accent-1), var(--utc-accent-2));
  transition: width 0.4s ease;
}
.utc-progress-label {
  color: var(--utc-text-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}

.utc-popup-title {
  color: var(--utc-text);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.utc-popup-sub {
  color: var(--utc-text-dim);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 20px;
}

.utc-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 10px;
  border-radius: 12px;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--utc-border);
  color: var(--utc-text);
  background: var(--utc-glass);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.utc-popup-btn:not(.disabled):not(.waiting):hover {
  background: var(--utc-glass-strong);
  transform: translateY(-2px);
}

.utc-popup-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.utc-popup-btn.waiting {
  background: linear-gradient(135deg, rgba(248,113,113,0.35), rgba(220,38,38,0.25));
  border-color: transparent;
  pointer-events: none;
}
.utc-popup-btn.success {
  background: linear-gradient(135deg, var(--utc-success), #10b981);
  border-color: transparent;
  color: #06251c;
  pointer-events: none;
}

.utc-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: utcSpin 0.75s linear infinite;
}
@keyframes utcSpin { to { transform: rotate(360deg); } }

.utc-like-hint {
  display: none;
  color: var(--utc-text-dim);
  font-size: 11px;
  margin-top: 8px;
}

.utc-enter-btn {
  display: none;
  width: 100%;
  margin-top: 16px;
  padding: 13px 18px;
  border-radius: 12px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  color: #06251c;
  background: linear-gradient(135deg, var(--utc-success), #10b981);
  box-shadow: 0 10px 28px rgba(52,211,153,0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.utc-enter-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(52,211,153,0.42); }

.utc-toast {
  position: fixed;
  top: 18px; right: 18px;
  background: linear-gradient(135deg, var(--utc-success), #10b981);
  color: #06251c;
  padding: 11px 20px;
  border-radius: 10px;
  font-family: 'Sarabun', sans-serif;
  font-weight: 700;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.utc-toast.show { opacity: 1; transform: translateY(0); }

/* ---- bilingual text: English primary, Thai subtitle ---- */
.utc-en {
  display: block;
  font-weight: 700;
}
.utc-th {
  display: block;
  font-weight: 400;
  opacity: 0.62;
}

/* inside buttons: icon + stacked English/Thai, centered */
.utc-btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.35;
}
.utc-btn .utc-th,
.utc-unlock-btn .utc-th,
.utc-popup-btn .utc-th,
.utc-enter-btn .utc-th {
  font-size: 11px;
}

/* non-button bilingual blocks */
.utc-lock-text .utc-th { font-size: 12.5px; margin-top: 2px; }
.utc-popup-title .utc-th { font-size: 12px; margin-top: 2px; }
.utc-popup-sub .utc-th { font-size: 12px; margin-top: 3px; }
.utc-like-hint .utc-th { font-size: 10px; margin-top: 2px; }
.utc-toast .utc-th { font-size: 11px; margin-top: 1px; opacity: 0.85; }
.utc-progress-label .utc-th { font-size: 10.5px; margin-top: 1px; }

.utc-btn:focus-visible,
.utc-unlock-btn:focus-visible,
.utc-popup-btn:focus-visible,
.utc-enter-btn:focus-visible {
  outline: 2px solid var(--utc-accent-2);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .utc-card { padding: 22px 16px; }
  .utc-aura { width: 320px; height: 320px; }
}
