/* =============================================================================
   RTK Self Service Password - theme in the style of myRTK
   ========================================================================== */

:root {
  --bg: #faf6f6;
  --card: #fffafa;
  --surface: #ffffff;
  --border: #f0d6d8;
  --border-strong: #e3c2c5;
  --tile: #f6e1e3;
  --maroon: #8b0a14;
  --maroon-hover: #a1101d;
  --maroon-dark: #5a050c;
  --heading: #1a1214;
  --text: #2b2325;
  --muted: #6e6466;
  --placeholder: #a6999b;
  --focus-ring: 0 0 0 3px rgba(139, 10, 20, 0.18);
  --shadow: 0 1px 2px rgba(90, 5, 12, 0.04), 0 6px 18px rgba(90, 5, 12, 0.06);
  --shadow-hero: 0 12px 32px rgba(90, 5, 12, 0.28);
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;

  --success: #18703f;
  --success-bg: #ecf7f0;
  --success-border: #c3e6d0;
  --success-tile: #d5efdf;
  --warning: #85550a;
  --warning-bg: #fff7e8;
  --warning-border: #f2dcae;
  --warning-tile: #fbe9c4;
  --danger: #9f111d;
  --danger-bg: #fdeff0;
  --danger-border: #f2c4c8;
  --danger-tile: #f9d9dc;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

/* ---------------------------------------------------------------- base --- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.25;
}

a {
  color: var(--maroon);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--maroon-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(139, 10, 20, 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--maroon);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

/* -------------------------------------------------------------- layout --- */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 190px;
}

.content {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.tiles {
  display: grid;
  gap: 16px;
}

.site-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(115deg, #8b0a14 0%, #730811 55%, #5a050c 100%);
  color: #fff;
  box-shadow: var(--shadow-hero);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  background: url("../images/logo.png") center / contain no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

.hero-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hero-logo {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hero-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.hero-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.hero-note {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
  line-height: 1.45;
}

.hero-note-label {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------- cards --- */

.card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.card-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.card-sub p {
  margin: 0 0 4px;
}

.card-head-text {
  min-width: 0;
  padding-top: 2px;
}

.card-compact .card-head {
  margin-bottom: 12px;
}

.card-compact .card-title {
  font-size: 17px;
}

.icon-tile {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--tile);
  color: var(--maroon);
  font-size: 19px;
}

.list {
  margin: 0;
  padding-left: 20px;
}

.list li {
  margin: 6px 0;
}

.list li::marker {
  color: var(--maroon);
}

.link-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.link-list a::after {
  content: "\f105"; /* fa-angle-right */
  font-family: FontAwesome;
  color: var(--maroon);
  font-size: 18px;
}

.link-list a:hover {
  border-color: var(--border-strong);
  background: var(--tile);
  color: var(--maroon);
}

/* --------------------------------------------------------------- forms --- */

.form {
  margin: 0;
}

.field {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  color: #b0898d;
  text-align: center;
  pointer-events: none;
}

.input {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px or more: no zoom on iOS */
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.input:hover {
  border-color: #d6a9ae;
}

.input:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: var(--focus-ring);
}

.input[disabled] {
  background: #f7eeef;
  color: var(--muted);
  cursor: not-allowed;
}

.input-wrap.has-toggle .input {
  padding-right: 54px;
}

.field-static {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.form-actions {
  margin-top: 22px;
}

/* ------------------------------------------------------------- buttons --- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--maroon);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 10, 20, 0.25);
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.btn-primary:hover {
  background: var(--maroon-hover);
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 10, 20, 0.32);
}

.btn-primary:active {
  background: var(--maroon-dark);
  transform: translateY(1px);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(139, 10, 20, 0.4);
  outline-offset: 3px;
}

/* -------------------------------------------------------------- alerts --- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}

.notice-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--tile);
  color: var(--maroon);
  font-size: 17px;
}

.notice-body {
  min-width: 0;
  padding-top: 6px;
  overflow-wrap: anywhere;
}

.notice-body p {
  margin: 0;
}

.notice a {
  color: inherit;
  font-weight: 600;
}

.notice-success {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: #0f4d2b;
}

.notice-success .notice-icon {
  background: var(--success-tile);
  color: var(--success);
}

.notice-warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: #5e3c05;
}

.notice-warning .notice-icon {
  background: var(--warning-tile);
  color: var(--warning);
}

.notice-danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: #6f0b14;
}

.notice-danger .notice-icon {
  background: var(--danger-tile);
  color: var(--danger);
}

/* ------------------------------------------------------- password rules --- */

.pw-rules {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.pw-rules-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pw-rules ul {
  display: grid;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pw-rule {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.pw-rule .fa {
  margin-top: 2px;
}

.pw-rule.is-ok {
  color: var(--success);
}

.pw-rule.is-bad {
  color: var(--danger);
}

.pw-match {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.pw-match.is-ok {
  color: var(--success);
}

.pw-match.is-bad {
  color: var(--danger);
}

.pw-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.pw-toggle:hover {
  background: var(--tile);
  color: var(--maroon);
}

.pw-toggle[aria-pressed="true"] {
  color: var(--maroon);
}

.pw-toggle:focus-visible {
  outline: 3px solid rgba(139, 10, 20, 0.35);
  outline-offset: -3px;
}

/* Hide the built-in reveal button in Edge so there is only one eye */
.input::-ms-reveal {
  display: none;
}

/* --------------------------------------------------------- cookie bar --- */

.cookie-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 1076px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 12px 32px rgba(90, 5, 12, 0.18);
  font-size: 14px;
  line-height: 1.45;
}

.cookie-bar .icon-tile {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.cookie-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 1px;
}

.cookie-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -4px -4px -4px 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.cookie-close:hover {
  background: var(--tile);
  color: var(--maroon);
}

/* ------------------------------------------------------------ tab menu --- */

.tabs {
  margin-top: 16px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* Phones: one row that scrolls sideways */
.tabs-list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs-list::-webkit-scrollbar {
  display: none;
}

.tabs-list li {
  flex: none;
  scroll-snap-align: start;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.tab .fa {
  color: var(--maroon);
}

.tab .fa-mobile {
  font-size: 1.25em;
}

.tab-ext {
  font-size: 11px;
  opacity: 0.55;
}

.tab:hover {
  background: var(--tile);
  color: var(--maroon);
}

.tab.is-active {
  background: var(--maroon);
  color: #fff;
  box-shadow: 0 3px 10px rgba(139, 10, 20, 0.25);
}

.tab.is-active .fa {
  color: #fff;
}

.tab:focus-visible {
  outline: 3px solid rgba(139, 10, 20, 0.35);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------- captcha --- */

.captcha {
  min-height: 78px;
}

.g-recaptcha {
  display: inline-block;
  max-width: 100%;
}

/* --------------------------------------------------- legacy page markup ---
   Fallback for pages that are not enabled at RTK (security questions,
   SSH key) and still use the original Bootstrap class names.            */

.alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.alert-success { border-color: var(--success-border); background: var(--success-bg); }
.alert-warning { border-color: var(--warning-border); background: var(--warning-bg); }
.alert-danger { border-color: var(--danger-border); background: var(--danger-bg); }

.form-group {
  margin-bottom: 16px;
}

.control-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: 16px;
}

.form-control:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: var(--focus-ring);
}

.input-group-addon {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--maroon);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------------------------------------------------------- responsive --- */

/* Very narrow phones: the reCAPTCHA widget is a fixed 304px wide */
@media (max-width: 379px) {
  .g-recaptcha {
    transform: scale(0.9);
    transform-origin: 0 0;
    margin-bottom: -8px;
  }
}

@media (min-width: 560px) {
  .btn-primary {
    width: auto;
  }

  .pw-rules ul {
    grid-template-columns: 1fr 1fr;
  }

  .cookie-bar {
    align-items: center;
    padding: 12px 12px 12px 16px;
  }
}

@media (min-width: 768px) {
  .page {
    padding: 32px 24px 120px;
  }

  .hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 186px;
    padding: 28px 32px;
  }

  .hero::after {
    right: 18%;
    bottom: -120px;
    width: 340px;
    height: 340px;
  }

  .hero-brand {
    gap: 20px;
  }

  .hero-logo {
    width: 84px;
    height: 84px;
    padding: 4px;
  }

  .hero-kicker {
    font-size: 13px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-note {
    flex: 0 1 340px;
    padding: 14px 18px;
  }

  .tabs {
    margin-top: 20px;
  }

  /* Desktop: tabs wrap instead of scrolling */
  .tabs-list {
    flex-wrap: wrap;
    overflow: visible;
  }

  .content {
    gap: 20px;
    margin-top: 20px;
  }

  .card {
    padding: 28px;
  }

  .card-compact {
    padding: 22px 24px;
  }

  .card-title {
    font-size: 22px;
  }

  .card-compact .card-title {
    font-size: 17px;
  }

  .card-narrow .form {
    max-width: 560px;
  }

  .tiles {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .notice {
    padding: 14px 18px;
  }
}

@media (min-width: 920px) {
  .layout-aside {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
