/*
 * Adopted from the Ops Console auth screens, which took it from the CRM login.
 * White rounded card on #f8f9fa, dark #2d3436 accent, spring easing.
 * Moved out of an inline style block because the content policy here forbids one.
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: cardSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  margin-bottom: 10px;
  animation: iconBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.auth-logo img { width: 72%; max-width: 240px; height: auto; }

@keyframes iconBounce {
  from { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}

.auth-product {
  color: #636e72;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: textFadeIn 0.5s ease 0.28s both;
}

.auth-title {
  color: #2d3436;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  animation: textFadeIn 0.5s ease 0.3s both;
}

.auth-subtitle {
  color: #636e72;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
  animation: textFadeIn 0.5s ease 0.35s both;
}

.auth-identity {
  color: #2d3436;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
  animation: textFadeIn 0.5s ease 0.4s both;
}

/* The chip echoing back what was typed on the previous step. */
.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #2d3436;
  margin-bottom: 24px;
  animation: textFadeIn 0.5s ease 0.4s both;
}

.identity-chip .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2d3436;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.identity-chip a { color: #636e72; text-decoration: none; font-size: 16px; line-height: 1; }
.identity-chip a:hover { color: #2d3436; }

@keyframes textFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.spacer { height: 14px; }

.field {
  text-align: left;
  margin-bottom: 18px;
  animation: textFadeIn 0.5s ease 0.45s both;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #636e72;
  margin-bottom: 7px;
  padding-left: 2px;
}

.field input[type=text],
.field input[type=password] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #f8fafc;
  color: #2d3436;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.field input:focus {
  border-color: #2d3436;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45, 52, 54, 0.08);
}

.otp-input-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.otp-digit {
  width: 48px;
  height: 58px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #2d3436;
  background: #f8fafc;
  outline: none;
  -webkit-appearance: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.otp-digit:nth-child(1) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both; }
.otp-digit:nth-child(2) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.50s both; }
.otp-digit:nth-child(3) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s both; }
.otp-digit:nth-child(4) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.60s both; }
.otp-digit:nth-child(5) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.65s both; }
.otp-digit:nth-child(6) { animation: digitPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.70s both; }

@keyframes digitPop {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.otp-digit:focus {
  border-color: #2d3436;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45, 52, 54, 0.08);
  transform: scale(1.05);
}

.otp-digit.filled { border-color: #2d3436; background: #fff; }

.otp-digit.shake {
  animation: inputShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #e74c3c;
}

@keyframes inputShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.submit-btn {
  width: 100%;
  background: #2d3436;
  color: #fff;
  font-weight: 500;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: textFadeIn 0.5s ease 0.75s both;
  display: block;
  text-align: center;
  text-decoration: none;
}

.submit-btn:hover { background: #1e2426; transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.submit-btn.loading { color: transparent; pointer-events: none; }

.submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none;
  border: none;
  color: #636e72;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  padding: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-block;
}

.link-btn:hover { color: #2d3436; }

.alert {
  padding: 12px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.45;
}

.alert.error, .alert.danger {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.2);
  color: #c0392b;
}

.alert.success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.25);
  color: #1e8449;
}

.alert.info {
  background: rgba(45, 52, 54, 0.05);
  border: 1px solid rgba(45, 52, 54, 0.12);
  color: #2d3436;
}

.meta { color: #636e72; font-size: 12.5px; margin-top: 18px; line-height: 1.6; }
.meta a { color: #636e72; }

.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: #2d3436; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 6px;
  color: #b2bec3;
  font-size: 12px;
}

.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* Account page additions, same language. */
.panel {
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  background: #f8fafc;
}

.panel h2 { font-size: 15px; font-weight: 600; color: #2d3436; margin-bottom: 6px; }
.panel p { font-size: 13.5px; color: #636e72; line-height: 1.55; }

.section-label {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #b2bec3;
  margin: 24px 0 10px;
}

.state { text-align: left; font-size: 14px; color: #2d3436; margin-bottom: 8px; }

.qr { margin-bottom: 18px; }
.qr svg { width: 190px; height: 190px; background: #fff; padding: 8px; border-radius: 12px; }

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 1px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 11px;
  margin-bottom: 18px;
  color: #2d3436;
}

.codes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.codes li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 11px;
  border-radius: 10px;
  color: #2d3436;
}

.apps { list-style: none; text-align: left; }
.apps li { padding: 10px 0; border-bottom: 1px solid #e2e8f0; font-size: 14px; color: #2d3436; }
.apps li:last-child { border-bottom: none; }

.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.row .submit-btn { margin: 0; }
.inline { display: inline; }

@media (max-width: 420px) {
  .auth-card { padding: 34px 22px; }
  .otp-digit { width: 42px; height: 52px; font-size: 19px; }
  .codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, .auth-card, .auth-logo, .otp-digit { animation: none !important; transition: none !important; }
  .submit-btn.loading { color: inherit; }
  .submit-btn.loading::after { display: none; }
}
