/* ===== GodaSmartCard – NFC Smart Card (Vietnam) ===== */
#view-nfc {
  --nfc: #06b6d4;
  --nfc-grad: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --zalo: #0068ff;
  --zalo-grad: linear-gradient(135deg, #0068ff 0%, #00a8ff 100%);
  --fb: #1877f2;
  --fb-grad: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
}

.nfc-page { animation: nfcFadeIn 0.45s ease both; }

@keyframes nfcFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nfc-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.nfc-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.nfc-hero::after {
  content: '';
  position: absolute;
  bottom: -50%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.nfc-hero-content { position: relative; z-index: 1; }

.nfc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(6,182,212,0.15);
  border: 1px solid rgba(6,182,212,0.3);
  color: var(--nfc);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.nfc-hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--nfc);
  border-radius: 50%;
  animation: nfcPulseDot 2s infinite;
}

@keyframes nfcPulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(6,182,212,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(6,182,212,0); }
}

.nfc-hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nfc-hero-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--nfc-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(6,182,212,0.4);
}

.nfc-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 720px;
}

.nfc-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nfc-btn-nfc {
  background: var(--nfc-grad) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(6,182,212,0.35);
}

.nfc-btn-zalo {
  background: var(--zalo-grad) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(0,104,255,0.35);
}

.nfc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .nfc-grid-2 { grid-template-columns: 1fr; }
}

.nfc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.nfc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.nfc-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nfc-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.nfc-card-icon.nfc { background: var(--nfc-grad); box-shadow: 0 6px 20px rgba(6,182,212,0.35); }
.nfc-card-icon.zalo { background: var(--zalo-grad); box-shadow: 0 6px 20px rgba(0,104,255,0.35); }
.nfc-card-icon.vcard { background: var(--brand-grad); box-shadow: 0 6px 20px rgba(99,102,241,0.35); }
.nfc-card-icon.qr { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 6px 20px rgba(245,158,11,0.35); }
.nfc-card-icon.read { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 6px 20px rgba(34,197,94,0.35); }

.nfc-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.nfc-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.nfc-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.nfc-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: nfcPulseDot 2s infinite;
}

.nfc-status-dot.unsupported {
  background: var(--danger);
  animation: none;
}

.nfc-status-dot.warning {
  background: var(--warning);
  animation: none;
}

.nfc-status-text {
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
}

.nfc-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nfc-status-badge.ok {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.nfc-status-badge.err {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

.nfc-form-group { margin-bottom: 16px; }

.nfc-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.nfc-form-label .req { color: var(--danger); }

.nfc-form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nfc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .nfc-form-row { grid-template-columns: 1fr; }
}

.nfc-write-zone {
  position: relative;
  padding: 36px 20px;
  text-align: center;
  background: var(--surface-2);
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: all 0.3s;
}

.nfc-write-zone.active {
  border-color: var(--nfc);
  background: rgba(6,182,212,0.05);
}

.nfc-write-zone.success {
  border-color: var(--success);
  background: rgba(34,197,94,0.05);
}

.nfc-write-zone.error {
  border-color: var(--danger);
  background: rgba(239,68,68,0.05);
}

.nfc-wave-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--nfc-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  position: relative;
  box-shadow: 0 12px 32px rgba(6,182,212,0.4);
}

.nfc-wave-icon::before,
.nfc-wave-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--nfc);
  opacity: 0;
}

.nfc-write-zone.active .nfc-wave-icon::before {
  animation: nfcRing 1.5s ease-out infinite;
}

.nfc-write-zone.active .nfc-wave-icon::after {
  animation: nfcRing 1.5s ease-out 0.5s infinite;
}

@keyframes nfcRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.nfc-write-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.nfc-write-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

.nfc-tag-preview {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.nfc-tag-preview::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(6,182,212,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.nfc-tag-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.nfc-tag-preview-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.nfc-tag-preview-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--nfc-grad);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.nfc-tag-preview-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nfc-tag-preview-body {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.nfc-tag-preview-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}

.nfc-tag-preview-name {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}

.nfc-tag-preview-role {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.nfc-tag-preview-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  opacity: 0.65;
  flex-wrap: wrap;
}

.nfc-tag-preview-meta i { font-size: 10px; margin-right: 3px; }

.nfc-read-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  animation: nfcSlideDown 0.3s ease;
}

.nfc-read-result[hidden] { display: none !important; }

@keyframes nfcSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nfc-read-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.nfc-read-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(34,197,94,0.15);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 13px;
}

.nfc-read-result-title {
  font-size: 13.5px;
  font-weight: 700;
}

.nfc-read-result-data {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: 8px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.nfc-read-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nfc-quick-templates {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .nfc-quick-templates { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .nfc-quick-templates { grid-template-columns: 1fr; }
}

.nfc-quick-template {
  padding: 14px 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s;
  font-family: inherit;
  color: var(--text);
}

.nfc-quick-template:hover {
  border-color: var(--nfc);
  background: rgba(6,182,212,0.05);
  transform: translateY(-2px);
}

.nfc-quick-template.selected {
  border-color: var(--nfc);
  background: rgba(6,182,212,0.1);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}

.nfc-quick-template-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
}

.nfc-quick-template-name {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.nfc-quick-template-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.nfc-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.nfc-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nfc-history-item:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

.nfc-history-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.nfc-history-info { flex: 1; min-width: 0; }

.nfc-history-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.nfc-history-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nfc-history-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.nfc-history-status.success {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.nfc-history-status.failed {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

.nfc-empty-state {
  text-align: center;
  padding: 32px 20px;
}

.nfc-empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 24px;
  color: var(--text-muted);
}

.nfc-empty-state-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.nfc-empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.nfc-qr-fallback {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

.nfc-qr-fallback-box {
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nfc-qr-fallback-box canvas,
.nfc-qr-fallback-box img {
  width: 100% !important;
  height: 100% !important;
}

.nfc-qr-fallback-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.nfc-qr-fallback-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.nfc-info-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.nfc-info-box i {
  color: var(--info);
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.nfc-info-box-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.nfc-info-box-text strong {
  color: var(--text);
  font-weight: 700;
}

.nfc-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nfc-guide-step {
  display: flex;
  gap: 14px;
}

.nfc-guide-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--nfc-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.nfc-guide-step-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.nfc-guide-step-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.nfc-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nfc-actions-row .btn { flex: 1; min-width: 140px; justify-content: center; }

.nfc-deep-fields[hidden] { display: none !important; }

@media (max-width: 768px) {
  .nfc-hero { padding: 22px 18px; }
  .nfc-hero-title { font-size: 20px; }
  .nfc-card { padding: 20px; }
  .nfc-qr-fallback { flex-direction: column; text-align: center; }
}
