* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e8e8e8;
  background: #000 url("bg.png") center / cover no-repeat fixed;
}

/* ---------- layout ---------- */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 28px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: #fff;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.center-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hero {
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 28px 0;
}

.foot {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: #888;
}

.home-logo {
  position: fixed;
  bottom: 18px;
  right: 18px;
  opacity: 0.8;
}
.home-logo:hover {
  opacity: 1;
}
.home-logo img {
  display: block;
}

/* ---------- choice screen ---------- */

.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  width: 100%;
  padding: 13px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #000;
  color: #fff;
  border: 1px solid #4a4a4a;
  cursor: pointer;
  text-align: left;
  padding-left: 16px;
}

.choice-btn:hover {
  border-color: #fff;
}

.choice-btn.primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.choice-btn.primary:hover {
  background: #000;
  color: #fff;
}

/* ---------- tool ---------- */

.tool {
  text-align: left;
  border: 1px solid #4a4a4a;
  background: #0a0a0a;
  padding: 20px;
}

.field-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #000;
  border: 1px solid #4a4a4a;
  color: #fff;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #fff;
}

input::placeholder {
  color: #555;
}

.login-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.login-actions .choice-btn {
  padding-left: 0;
  text-align: center;
}

/* ---------- output ---------- */

.output {
  margin-top: 16px;
  border-top: 1px solid #333;
  padding-top: 16px;
}

.output-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-box {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #333;
  background: #000;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-prefix {
  color: #888;
}

.code-suffix {
  color: #fff;
}

.copy-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 700;
  background: #000;
  color: #ccc;
  border: 1px solid #4a4a4a;
  cursor: pointer;
}

.copy-btn:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* ---------- meter ---------- */

.meter {
  margin-top: 12px;
}

.meter-track {
  height: 4px;
  background: #222;
  border: 1px solid #333;
}

.meter-fill {
  height: 100%;
  width: 0%;
  transition: width 0.15s linear;
  background: #fff;
}

.meter-fill.bad {
  background: #ff6b6b;
}

.meter-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #ccc;
}

.meter-label.bad {
  color: #ff6b6b;
}

/* ---------- errors ---------- */

.error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #888;
  color: #ddd;
  font-size: 12px;
}

/* ---------- redirect screen ---------- */

#redirect-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#redirect-screen[hidden] {
  display: none;
}

.redirect-box {
  text-align: center;
  color: #ccc;
  font-size: 13px;
}

.redirect-target {
  color: #666;
  font-size: 11px;
  word-break: break-all;
  max-width: 320px;
  margin: 8px auto 0;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  border-bottom: 1px solid #666;
  text-decoration: none;
  font-size: 12px;
}
.back-link:hover {
  border-bottom-color: #fff;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #333;
  border-top-color: #fff;
  margin: 0 auto 14px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}