/* ============================================================
   CRYPTYRE Merchant Portal — Auth page styles
   Inherits variables from ../css/style.css
   ============================================================ */

/* ── Layout ── */
.auth-page {
  min-height: 100vh;
  background: var(--stripe-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* subtle aurora background */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(99,91,255,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(0,212,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Card ── */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-xl);
  padding: 40px;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.36);
}

/* ── Logo ── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}
.auth-logo .logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--stripe-purple), var(--stripe-cyan));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}
.auth-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.auth-logo .logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  line-height: 1;
}

/* ── Headings ── */
.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.auth-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.50);
  margin-bottom: 28px;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.70);
}
.field input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.field input::placeholder {
  color: rgba(255,255,255,0.25);
}
.field input:focus {
  border-color: var(--stripe-purple);
  background: rgba(99,91,255,0.08);
}

/* ── Submit button ── */
.auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--stripe-purple);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  box-shadow: var(--shadow-purple);
  margin-top: 4px;
}
.auth-btn:hover:not(:disabled) {
  background: var(--stripe-purple-h);
  box-shadow: 0 6px 24px rgba(99,91,255,0.45);
  transform: translateY(-1px);
}
.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Error / success messages ── */
.auth-msg {
  display: none;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.auth-msg.error {
  display: block;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.30);
  color: #FCA5A5;
}
.auth-msg.success {
  display: block;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.30);
  color: #86EFAC;
}

/* ── Footer link ── */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.40);
}
.auth-footer a {
  color: var(--stripe-purple-l);
  font-weight: 600;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Row layout (name + phone side by side) ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .auth-card  { padding: 28px 22px; }
  .field-row  { grid-template-columns: 1fr; }
}


/* ============================================================
   Portal shell — shared layout for all feature pages
   ============================================================ */

.portal-body { background: var(--gray-50); min-height: 100vh; }

/* ── Top nav (shared across portal pages) ── */
.portal-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-xs);
}
.portal-nav .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text);
  text-decoration: none;
}
.portal-nav .brand .mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--stripe-purple), var(--stripe-cyan));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.portal-nav .nav-right { display: flex; align-items: center; gap: 14px; }
.portal-nav .merchant-name { font-size: 13px; color: var(--text-medium); font-weight: 500; }
.portal-nav .merchant-name strong { color: var(--stripe-purple); }
.portal-nav .sign-out-btn {
  font-size: 13px; font-weight: 600; color: var(--text-light);
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 14px;
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s;
}
.portal-nav .sign-out-btn:hover { border-color: var(--stripe-purple); color: var(--stripe-purple); }

/* ── Layout: sidebar + main ── */
.portal-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.portal-sidebar {
  width: 216px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-light);
  padding: 0 10px;
  margin: 14px 0 5px;
}
.sidebar-label:first-child { margin-top: 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-medium);
  text-decoration: none;
  transition: background .13s, color .13s;
  margin-bottom: 1px;
}
.sidebar-link svg { width: 16px; height: 16px; opacity: .6; flex-shrink: 0; }
.sidebar-link:hover { background: var(--gray-50); color: var(--text); }
.sidebar-link:hover svg { opacity: .9; }
.sidebar-link.active {
  background: rgba(99,91,255,0.09);
  color: var(--stripe-purple);
  font-weight: 600;
}
.sidebar-link.active svg { opacity: 1; }

.portal-main {
  flex: 1;
  padding: 32px 28px;
  min-width: 0;
}

/* ── Tool page header ── */
.tool-header { margin-bottom: 24px; }
.tool-breadcrumb {
  font-size: 12px; color: var(--text-light);
  margin-bottom: 8px;
}
.tool-breadcrumb a { color: var(--text-light); text-decoration: none; }
.tool-breadcrumb a:hover { color: var(--stripe-purple); }
.tool-breadcrumb span { margin: 0 5px; }
.tool-header h1 {
  font-size: 21px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px; margin-bottom: 4px;
}
.tool-header p { font-size: 14px; color: var(--text-light); }

/* ── Generic tool card ── */
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
}
.tool-card-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* ============================================================
   3rd Party Check — specific styles
   ============================================================ */

/* Two-column layout: form | result */
.check-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

/* ── Check form ── */
.check-form { display: flex; flex-direction: column; gap: 18px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 13px; font-weight: 600; color: var(--text-medium);
}
.form-field input,
.form-field select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--white);
  outline: none;
  transition: border-color .17s, box-shadow .17s;
  -webkit-appearance: none; appearance: none;
  width: 100%;
}
.form-field input:focus,
.form-field select:focus {
  border-color: var(--stripe-purple);
  box-shadow: 0 0 0 3px rgba(99,91,255,0.12);
}
.form-field input::placeholder { color: var(--gray-300); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-light);
  pointer-events: none;
}
.select-wrap select { padding-right: 34px; cursor: pointer; }

/* selected bank indicator strip */
.bank-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
}
.bank-indicator.visible { display: flex; }
.bank-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}

.check-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px;
  background: var(--stripe-purple); color: #fff;
  border: none; border-radius: var(--r);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: background .17s, box-shadow .17s, transform .12s;
  box-shadow: var(--shadow-purple);
}
.check-btn:hover:not(:disabled) {
  background: var(--stripe-purple-h);
  box-shadow: 0 6px 20px rgba(99,91,255,0.38);
  transform: translateY(-1px);
}
.check-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Result card ── */
.result-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  transition: border-color .25s;
}
.result-card.state-found     { border-color: rgba(34,197,94,0.40);  background: rgba(34,197,94,0.015); }
.result-card.state-not-found { border-color: rgba(234,179,8,0.40);  background: rgba(234,179,8,0.015); }
.result-card.state-error     { border-color: rgba(239,68,68,0.40);  background: rgba(239,68,68,0.015); }

/* idle placeholder */
.result-idle {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 180px; text-align: center;
}
.result-idle .idle-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gray-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.result-idle p { font-size: 13px; color: var(--text-light); max-width: 200px; line-height: 1.5; }

/* content shown after a check */
.result-content { display: none; }
.result-card:not(.state-idle) .result-idle  { display: none; }
.result-card:not(.state-idle) .result-content { display: block; }

.result-status-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.result-status-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.state-loading  .result-status-icon { background: var(--gray-50); }
.state-found    .result-status-icon { background: rgba(34,197,94,0.12); }
.state-not-found .result-status-icon { background: rgba(234,179,8,0.12); }
.state-error    .result-status-icon { background: rgba(239,68,68,0.12); }

.result-status-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); margin-bottom: 3px;
}
.result-account-name {
  font-size: 20px; font-weight: 700;
  color: var(--text); letter-spacing: -0.2px;
}
.state-found     .result-account-name { color: #15803d; }
.state-not-found .result-account-name { color: #92400e; }
.state-error     .result-account-name { color: #b91c1c; }

.result-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.result-meta-item .meta-key {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 2px;
}
.result-meta-item .meta-val {
  font-size: 13px; font-weight: 600; color: var(--text-medium);
}

/* spinner */
.spin-icon {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(99,91,255,0.18);
  border-top-color: var(--stripe-purple);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Recent checks table ── */
.recent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.recent-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.recent-head h3 { font-size: 13px; font-weight: 700; color: var(--text); }
.clear-history-btn {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  background: none; border: none; cursor: pointer;
  font-family: inherit; padding: 3px 8px;
  border-radius: var(--r-sm);
  transition: color .13s, background .13s;
}
.clear-history-btn:hover { color: #dc2626; background: rgba(239,68,68,0.07); }

.checks-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.checks-table th {
  text-align: left; padding: 9px 22px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-light);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
.checks-table td {
  padding: 12px 22px;
  border-bottom: 1px solid var(--gray-50);
  color: var(--text-medium);
  vertical-align: middle;
}
.checks-table tr:last-child td { border-bottom: none; }
.checks-table .cell-name { font-weight: 600; color: var(--text); }
.checks-table .cell-name.not-found { color: var(--text-light); font-style: italic; font-weight: 400; }
.checks-table .cell-name.error { color: #dc2626; font-weight: 500; }

.bank-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; color: var(--text);
}
.bank-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge.found     { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge.not-found { background: rgba(234,179,8,0.12);  color: #92400e; }
.badge.error     { background: rgba(239,68,68,0.12);  color: #dc2626; }

.recent-empty {
  padding: 36px 22px; text-align: center;
  font-size: 13px; color: var(--text-light);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .portal-sidebar { display: none; }
  .check-layout   { grid-template-columns: 1fr; }
  .portal-main    { padding: 24px 16px; }
}
@media (max-width: 480px) {
  .check-layout { gap: 14px; }
}
