/* code.yamin.bd — app-specific styles (shell tokens come from assets/yamin.css) */

main, section, article, header, footer, nav, figure, fieldset, output, dialog, aside {
  display: block;
  border: none;
}

:root {
  --code-dash: 2px dashed var(--bdr-hi);
}

:where(button, a, select, textarea, input):focus-visible {
  outline: 2px solid var(--bdr-hi);
  outline-offset: 2px;
}

/* ---------- Layout rhythm ---------- */

.card { padding: 20px; margin-bottom: 16px; }
@media (min-width: 640px) {
  .card { padding: 24px; }
}

.section-label { margin-bottom: 14px; }

.form-group { margin-bottom: 16px; }

.input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--txt-m);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-label kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--txt-m);
  text-transform: none;
  letter-spacing: 0;
}

.form-input.valid { border-color: rgba(16, 185, 129, 0.55); background: rgba(16, 185, 129, 0.04); }
.form-input.invalid { border-color: rgba(244, 63, 94, 0.45); }

.extracted-container {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--ind-l));
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(16, 185, 129, 0.28);
  animation: fadeIn 0.3s ease;
}

.extracted-container .extracted-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.extracted-container .extracted-left i { color: var(--em); flex-shrink: 0; }
.extracted-text { font-size: 0.84rem; font-weight: 700; color: var(--txt); word-break: break-all; }

/* ---------- Credential input ---------- */

.cred-panel { gap: 12px; margin-bottom: 16px; }

.cred-textarea:focus { background: var(--card); }

/* Progress sits between the input group and the button only while active */
.progress-wrap { margin-top: 0; margin-bottom: 16px; }

/* ---------- Primary action ---------- */

.btn-primary {
  width: 100%;
  padding: 15px;
  font-size: 0.88rem;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, var(--ind) 0%, #6366f1 50%, #818cf8 100%);
  background-size: 200% 100%;
  color: #fff;
  font-weight: 800;
  border: none;
  margin: 0 0 16px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
  transition: background-position 0.35s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn-primary:hover { background-position: 100% 0%; box-shadow: 0 6px 26px rgba(79, 70, 229, 0.5); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary.loading { opacity: 0.85; pointer-events: none; }
.btn-primary.loading .btn-spinner { display: inline-block; }
.btn-primary.loading .btn-icon { display: none; }

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-action { padding: 9px 14px; font-size: 0.7rem; min-height: 40px; }

/* ---------- Instruction card ---------- */

.instruction-card {
  margin-top: 4px;
  padding: 16px 18px;
  background: var(--ind-l);
  border: 1px solid var(--bdr);
  border-left: var(--code-dash);
  border-radius: var(--r-lg);
}

.instruction-card h4 {
  font-size: 0.7rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.instruction-card ul { display: flex; flex-direction: column; gap: 9px; }

.instruction-card li {
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--txt-s);
  margin: 0;
}

.instruction-card li i {
  margin-top: 6px;
  font-size: 0.5rem;
  color: var(--ind);
  flex-shrink: 0;
}

.instruction-card strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--txt);
}

/* ---------- Status bar ---------- */

.status-bar {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 14px;
  border: 1.5px solid var(--bdr);
  background: var(--bg2);
  color: var(--txt-s);
}

.status-bar.show { display: flex; }
.status-bar.error { border-color: rgba(244, 63, 94, 0.45); background: rgba(244, 63, 94, 0.08); color: var(--rose); }
.status-bar.ok { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); color: #059669; }
.status-bar i { margin-top: 2px; flex-shrink: 0; }

/* ---------- Results: latest code ticket ---------- */

.results-top-bar {
  background: transparent;
  border: var(--code-dash);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .results-top-bar { flex-direction: row; justify-content: space-between; }
}

.otp-compact { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
@media (min-width: 640px) {
  .otp-compact { width: auto; align-items: flex-start; }
}

.otp-compact .label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--txt-m);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.otp-compact strong {
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ind);
  letter-spacing: 6px;
  line-height: 1;
}

.action-group { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; justify-content: center; }
@media (min-width: 640px) { .action-group { width: auto; } }
.action-group .btn { flex: 1; white-space: nowrap; min-width: 0; }
.action-group .btn-outline {
  background: var(--ind-l);
  color: var(--ind);
  border: 1.5px solid var(--bdr-hi);
}
.action-group .btn-ghost {
  background: transparent;
  color: var(--txt-m);
  border: 1.5px solid var(--bdr);
}
.action-group .btn-ghost:hover { color: var(--ind); border-color: var(--bdr-hi); background: var(--ind-l); }

.results-account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--r-lg);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--txt-s);
}

.results-account-bar i { color: var(--ind); }
.results-account-bar strong { color: var(--txt); font-weight: 800; }

/* ---------- Mail cards ---------- */

#messages-list { display: flex; flex-direction: column; gap: 12px; }

.mail-card {
  background: var(--card);
  border: 1.5px solid var(--bdr);
  border-radius: var(--r-xl);
  padding: 18px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mail-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ind), #818cf8);
  border-radius: 4px 0 0 4px;
}

.mail-card:hover {
  border-color: var(--bdr-hi);
  box-shadow: 0 6px 24px var(--shd2);
  transform: translateY(-2px);
}

.mail-card.has-code { border-color: rgba(99, 102, 241, 0.35); }
.code-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fff;
  background: var(--em);
  padding: 3px 8px;
  border-radius: 99px;
}

.mail-index {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ind);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mail-avatar {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ind), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.mail-sender-info { min-width: 0; }
.mail-sender { font-weight: 700; color: var(--txt); font-size: 0.9rem; word-break: break-word; }
.mail-sender-sub { font-size: 0.72rem; color: var(--txt-m); word-break: break-all; }

/* Per-message code — dashed frame, no solid fill */
.mail-code-box {
  background: transparent;
  border: var(--code-dash);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.mail-code-val {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ind);
  letter-spacing: 4px;
  word-break: break-all;
}

.mail-copy-btn {
  background: var(--ind-l);
  color: var(--ind);
  border: 1px solid var(--bdr-hi);
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--t);
}

.mail-copy-btn:hover { background: var(--ind); color: #fff; }

.mail-content { margin-bottom: 14px; }
.mail-subject { display: block; font-weight: 600; color: var(--txt); font-size: 0.88rem; margin-bottom: 5px; word-break: break-word; }
.mail-snippet {
  color: var(--txt-m);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--bdr);
  padding-top: 12px;
  gap: 8px;
}

.btn-read-mail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ind-l);
  color: var(--ind);
  padding: 6px 12px;
  border: 1.5px solid var(--bdr-hi);
  border-radius: var(--r-md);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: var(--t);
}

.btn-read-mail:hover { background: var(--ind); color: #fff; }

.mail-time { color: var(--txt-m); font-size: 0.7rem; }

.empty-inbox { text-align: center; padding: 40px 20px; }
.empty-inbox-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--ind-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--ind);
}

/* ---------- Modal ---------- */

dialog.modal-overlay {
  display: none;
  position: fixed;
  z-index: 3000;
  inset: 0;
  background: var(--modal-overlay, rgba(15, 23, 42, 0.55));
  backdrop-filter: blur(10px);
  align-items: flex-start;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  margin: 0;
  border: none;
}

dialog.modal-overlay.show { display: flex; }
.modal-container {
  background: var(--card);
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bdr);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
}

.modal-header h3 {
  font-size: 0.92rem;
  margin: 0;
  font-weight: 700;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn-close {
  background: var(--ind-l);
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr);
  cursor: pointer;
  color: var(--ind);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}

.btn-close:hover { background: var(--ind); color: #fff; }

.modal-body { flex-grow: 1; background: var(--card); }
.modal-iframe { width: 100%; height: 100%; border: none; display: block; }

/* ---------- Skeleton + effects ---------- */

.skeleton-box {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bdr) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.otp-flash { animation: otpFlash 0.7s ease forwards; }
@keyframes otpFlash {
  0% { box-shadow: 0 6px 28px rgba(79, 70, 229, 0.4); }
  40% { box-shadow: 0 10px 44px rgba(79, 70, 229, 0.65); transform: scale(1.015); }
  100% { box-shadow: 0 6px 28px rgba(79, 70, 229, 0.4); transform: scale(1); }
}

.lang-select {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--txt-m);
  cursor: pointer;
}

/* ---------- Tutorial + welcome ---------- */

.tutorial-section .video-wrapper {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--bdr);
  background: #000;
}

.video-caption {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--txt-m);
  font-weight: 600;
}

#welcome-msg {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--bdr);
  background: var(--card);
}

#welcome-msg h2 { font-size: 1.05rem; font-weight: 800; }
#welcome-msg .accent { color: var(--ind); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Batch: collapsible account cards ---------- */

.batch-acc { padding: 0; cursor: default; }
.batch-acc:hover { transform: none; }

.batch-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 14px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--txt);
}

.batch-acc-no {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--txt-m);
  flex-shrink: 0;
}

.batch-acc-email {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-acc-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.batch-acc-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ind);
  letter-spacing: 1px;
  cursor: pointer;
}

.batch-acc-caret {
  color: var(--txt-m);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.batch-acc.open .batch-acc-caret { transform: rotate(180deg); }

.batch-acc-body {
  padding: 6px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--bdr);
}
.batch-acc-body[hidden] { display: none; }

.batch-acc-status { font-size: 0.8rem; color: var(--txt-m); font-weight: 600; padding: 8px 0; }
.batch-acc-status.err { color: var(--rose); }

.acc-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bdr);
  border-radius: var(--r-md);
  background: var(--bg2);
  cursor: pointer;
  transition: var(--t);
}
.acc-msg:hover { border-color: var(--bdr-hi); background: var(--ind-l); }
.acc-msg.has-code { border-left: 2px dashed var(--bdr-hi); }

.acc-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ind), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.acc-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.acc-msg-subject,
.acc-msg-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-msg-subject { font-size: 0.82rem; font-weight: 600; color: var(--txt); }
.acc-msg-snippet { font-size: 0.72rem; color: var(--txt-m); }

.acc-msg-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ind);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.acc-msg-open { color: var(--txt-m); font-size: 0.72rem; flex-shrink: 0; }

@media (max-width: 430px) {
  .action-group { flex-direction: column; }
  .action-group .btn { width: 100%; }
  .cred-counts { width: 100%; }
  .otp-compact strong { letter-spacing: 3px; font-size: 1.8rem; }
  .mail-card { padding: 16px; }
  .batch-acc { padding: 0; }
  .acc-msg-snippet { display: none; }
}
