/* ===== LAYOUT ===== */
.totp-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== INPUT PANEL ===== */
.input-panel { text-align: center; }

.input-hero { margin-bottom: 2rem; }
.input-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--accent-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-icon svg { stroke: var(--accent); }
.input-hero h1 { font-size: 1.75rem; margin-bottom: 0.35rem; }
.subtitle { color: var(--text-secondary); font-size: 0.95rem; }

/* --- Input card --- */
.input-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.input-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.input-row { display: flex; gap: 0.5rem; }
.input-row input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.88rem;
  font-family: 'Consolas', 'Monaco', monospace;
  transition: border-color var(--transition);
}
.input-row input:focus { outline: none; border-color: var(--accent); }

/* --- Divider --- */
.divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* --- QR buttons --- */
.qr-options {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.qr-btn {
  flex: 1;
  min-width: 160px;
  justify-content: center;
  cursor: pointer;
}

/* --- Camera --- */
.camera-section { margin-top: 1.25rem; text-align: center; }
.camera-section video {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  border: 2px solid var(--card-border);
  background: #000;
}
.camera-section button { margin-top: 0.65rem; }

/* ===== OTP PANEL ===== */
.otp-panel { animation: fadeUp 0.35s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- OTP Card (shared) --- */
.otp-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.account-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Circular timer ring --- */
.otp-ring-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 1.5rem;
}
.otp-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 6;
}
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.73; /* 2 * PI * 52 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
.ring-fg.danger { stroke: var(--error); }
.ring-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text);
}

/* --- Code display --- */
.otp-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.otp-code {
  font-size: 2.75rem;
  font-weight: 700;
  font-family: 'Consolas', 'Monaco', monospace;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: transparent;
  border: 2px dashed transparent;
  border-radius: var(--radius-sm);
  padding: 0.35rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-family: 'Consolas', 'Monaco', monospace;
}
.otp-code:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.otp-code:active { transform: translateY(0); }
.otp-code.copied {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--success);
  color: var(--success);
}
.otp-code.flash { animation: codeFlash 0.4s ease; }
@keyframes codeFlash {
  0%   { opacity: 0.3; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

.copy-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.copy-hint.copied { color: var(--success); }

/* --- Cancel button --- */
.cancel-btn {
  margin-top: 1rem;
  width: 100%;
}

/* ===== EXPIRED STATE ===== */
.otp-expired-card {
  animation: fadeUp 0.35s ease;
}
.expired-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.expired-icon svg { stroke: var(--text-secondary); }
.expired-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.expired-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.expired-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.expired-actions .btn { flex: 1; min-width: 140px; justify-content: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .totp-main { padding: 1.25rem 1rem; }
  .input-hero h1 { font-size: 1.4rem; }
  .input-icon { width: 48px; height: 48px; }
  .input-icon svg { width: 26px; height: 26px; }
  .otp-code { font-size: 2rem; letter-spacing: 0.06em; }
  .otp-card { padding: 1.5rem 1rem; }
  .input-row { flex-direction: column; }
  .input-row .btn { width: 100%; }
  .qr-options { flex-direction: column; }
  .qr-btn { min-width: 0; width: 100%; }
  .otp-ring-wrap { width: 90px; height: 90px; }
  .ring-time { font-size: 1.4rem; }
  .camera-section video { max-width: 100%; }
  .expired-actions { flex-direction: column; }
  .expired-actions .btn { min-width: 0; width: 100%; }
}
