/* ─── Login page — extracted from styles.css ─────────────────────────────── */

:root {
  --ntt-blue: #0072BC;
  --ntt-blue-light: #e8f4fc;
  --ntt-blue-hover: #005a96;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --amber: #d97706;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --bg-white: #ffffff;
  --bg-panel: #fafbfc;
  --border: #e0e4e8;
  --radius: 8px;
  --radius-sm: 5px;
  --radius-pill: 999px;
  --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  flex-shrink: 0;
}

.header-left {
  flex: 0 0 auto;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  flex-wrap: nowrap;
}

.header-center img {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

.header-center h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ntt-blue);
  letter-spacing: -0.3px;
}

.title-beta {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.5px;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.locale-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.locale-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.locale-select {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  max-width: 130px;
}
.locale-select:hover,
.locale-select:focus {
  border-color: var(--ntt-blue);
  color: var(--ntt-blue);
}

/* ─── Host mode badge ─────────────────────────────────────────────────────── */

.host-mode-badge {
  display: none;
}

body.landing-mode .host-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--green);
  white-space: nowrap;
}

/* ─── Input clearable ─────────────────────────────────────────────────────── */

.input-clearable {
  position: relative;
  flex: 1;
}

.input-clearable input {
  width: 100%;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
}
.input-clearable input:focus {
  outline: none;
  border-color: var(--ntt-blue);
  box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.15);
}
.input-clearable input:disabled {
  background: #f3f4f6;
  color: #999;
}

/* ─── Apply button ────────────────────────────────────────────────────────── */

.btn-apply {
  padding: 7px 16px;
  border: 1px solid var(--ntt-blue);
  border-radius: var(--radius-sm);
  background: var(--ntt-blue);
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-apply:hover:not(:disabled) {
  background: var(--ntt-blue-hover);
}
.btn-apply:disabled {
  cursor: default;
}
.btn-apply.btn-apply-success {
  background: var(--green);
  border-color: var(--green);
  color: white;
  font-size: 16px;
  font-weight: 700;
}

/* ─── Host key error ──────────────────────────────────────────────────────── */

.host-key-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
}

/* ─── Footer elements ─────────────────────────────────────────────────────── */

.footnote-sep {
  color: var(--border);
}

.footer-version {
  color: var(--text-secondary);
  opacity: 0.6;
}

.btn-version-footer {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--text-secondary);
  opacity: 0.6;
  cursor: pointer;
  line-height: inherit;
}

.btn-version-footer:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Landing overlay ────────────────────────────────────────────────────────── */

.landing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-white);
  flex-direction: column;
}
body.landing-mode .landing-overlay {
  display: flex;
}

.landing-header {
  padding: 0 24px;
  min-height: 56px;
}
.landing-header-center img {
  height: 32px;
  width: auto;
}
.landing-header-center h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ntt-blue);
  margin: 0;
}

.landing-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-key-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-card-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.landing-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-key-input-wrap {
  flex: 1;
}

.landing-footer {
  text-align: left;
  padding: 14px 32px;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    padding: 10px 14px 8px;
    gap: 6px 8px;
  }

  .header-center {
    grid-column: 1 / -1;
    grid-row: 1;
    position: static;
    transform: none;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  .header-center img {
    height: 26px;
  }

  .header-center h1 {
    font-size: 17px;
  }

  .header-left {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
  }

  .header-right {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
  }

  .locale-row {
    gap: 4px;
  }

  .locale-label {
    font-size: 11px;
  }

  .locale-select {
    font-size: 11px;
    padding: 3px 5px;
    max-width: 110px;
  }

  .landing-header {
    padding: 10px 14px 8px !important;
    min-height: unset !important;
  }

  .landing-key-card {
    min-width: 0;
    width: 100%;
    max-width: 400px;
    padding: 20px 16px;
  }

  .footer-beta,
  .footnote-beta-sep {
    display: none;
  }
}

@media (max-width: 400px) {
  .header-center h1 {
    font-size: 15px;
  }

  .header-center img {
    height: 22px;
  }
}
