:root {
  --bg: #0b0f14;
  --surface: #131820;
  --border: #1e2730;
  --accent: #00d4a0;
  --accent2: #0099ff;
  --danger: #ff4f6a;
  --warning: #ffb340;
  --text: #e8edf2;
  --muted: #5a6a78;
  --mono: 'DM Mono', monospace;
  --sans: 'Noto Sans JP', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow-x: hidden;
}

/* -- grid texture -- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 160, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 160, .03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* -- glow orbs -- */
body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 160, .06) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}

/* -- header -- */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.logo-mark::before,
.logo-mark::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: .5;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}

h1 span {
  display: block;
  font-size: .85rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: .05em;
  margin-top: .3rem;
  font-family: var(--mono);
}

/* -- card -- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* -- sections -- */
.section {
  animation: fadeUp .4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- status badge -- */
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  font-size: .85rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.green {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.dot.grey {
  background: var(--muted);
}

.dot.red {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.dot.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .4;
    transform: scale(.8);
  }
}

.status-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .75rem;
  white-space: nowrap;
}

.status-value {
  font-weight: 500;
  min-width: 0;
  flex-grow: 1;
  font-size: .8rem;
  font-family: var(--mono);
  color: var(--accent);
  word-break: break-word;
  text-align: right;
}

/* -- user info -- */
.user-info {
  background: rgba(0, 212, 160, .05);
  border: 1px solid rgba(0, 212, 160, .15);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: .85rem;
}

.user-info .label {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .3rem;
}

.user-info .email {
  color: var(--accent);
  font-family: var(--mono);
  font-size: .85rem;
}

/* -- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .85rem 1.5rem;
  border-radius: 10px;
  border: none;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .02em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: .8rem;
  padding: .6rem 1rem;
  width: auto;
}

.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}

.email-input-panel {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
}

.email-input-label {
  display: block;
  margin-bottom: .55rem;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.email-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .2);
  color: var(--text);
  font-family: var(--mono);
  font-size: .85rem;
  padding: .7rem .75rem;
  outline: none;
}

.email-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(0, 153, 255, .18);
}

.email-input-actions {
  margin-top: .75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}

.recent-login {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
}

.recent-login-label {
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: .5rem;
  letter-spacing: .05em;
}

.btn-recent {
  width: 100%;
  justify-content: flex-start;
  font-family: var(--mono);
  word-break: break-all;
}

/* -- result box -- */
.result {
  border-radius: 10px;
  padding: 1.25rem;
  font-size: .9rem;
  line-height: 1.6;
  margin-top: 1.5rem;
  display: none;
}

.result.show {
  display: block;
  animation: fadeUp .3s ease;
}

.result.success {
  background: rgba(0, 212, 160, .08);
  border: 1px solid rgba(0, 212, 160, .25);
  color: var(--accent);
}

.result.error {
  background: rgba(255, 79, 106, .08);
  border: 1px solid rgba(255, 79, 106, .25);
  color: var(--danger);
}

.result.warning {
  background: rgba(255, 179, 64, .08);
  border: 1px solid rgba(255, 179, 64, .25);
  color: var(--warning);
}

.result-icon {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}

.result-title {
  font-weight: 700;
  margin-bottom: .25rem;
}

.result-detail {
  font-size: .8rem;
  opacity: .8;
  font-family: var(--mono);
}

/* -- session info -- */
.session-info {
  background: rgba(0, 153, 255, .05);
  border: 1px solid rgba(0, 153, 255, .15);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.session-info .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  padding: .2rem 0;
}

.session-info .key {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
}

.session-info .val {
  color: var(--accent2);
  font-family: var(--mono);
  font-size: .8rem;
}

/* -- loading spinner -- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, .2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* -- divider -- */
.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: .75rem;
  font-family: var(--mono);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* -- footer -- */
.footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: .72rem;
  font-family: var(--mono);
  letter-spacing: .05em;
}

/* -- helper texts -- */
.info-text {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.note-text {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.7;
}

.center-note {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

.inline-accent {
  color: var(--accent2);
}

.actions-right {
  margin-top: 1.5rem;
  text-align: right;
}

/* -- hidden -- */
.hidden {
  display: none !important;
}