/*
  Alert 05 — Security Sign-in Alert — standalone HTML/CSS/JS
  implementation. No build step, no framework, no external dependency:
  copy index.html, this file, and script.js into any project as-is.
*/

:root {
  --alert-accent: #39ff14;
  --alert-fg: oklch(0.17 0 0);
  --alert-muted: oklch(0.48 0 0);
  --alert-border: oklch(0.92 0 0);
  --alert-border-strong: oklch(0.86 0 0);
  --alert-soft: oklch(0.97 0 0);
  --alert-ink-hover: oklch(0.3 0 0);
  --alert-map-ink: oklch(0.72 0 0);
  --alert-map: oklch(0.2 0.004 250);
}

.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;
}

/* The root is the size container the layout responds to. */
.alert05 {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--alert-border);
  border-radius: 1rem;
  background-color: #ffffff;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.alert05 p,
.alert05 dl,
.alert05 dd {
  margin: 0;
}

.alert05__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* The map tile: a dark street grid drawn with gradients — no image, no
   external tiles. */
.alert05__map {
  position: relative;
  height: 6rem;
  overflow: hidden;
  background-color: var(--alert-map);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(28deg, transparent 47%, rgba(255, 255, 255, 0.16) 47.5%, rgba(255, 255, 255, 0.16) 49%, transparent 49.5%),
    linear-gradient(118deg, transparent 58%, rgba(255, 255, 255, 0.1) 58.5%, rgba(255, 255, 255, 0.1) 60%, transparent 60.5%);
  background-size:
    18px 18px,
    18px 18px,
    100% 100%,
    100% 100%;
}

/* A neon pin with a single settling ring — it lands once, it doesn't pulse. */
.alert05__pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background-color: var(--alert-accent);
  translate: -50% -50%;
  box-shadow:
    0 0 0 3px var(--alert-map),
    0 0 0 4px rgba(57, 255, 20, 0.55);
  animation: alert05-land 700ms cubic-bezier(0.3, 0.8, 0.25, 1) both;
}

.alert05__coords {
  position: absolute;
  right: 0.625rem;
  bottom: 0.5rem;
  left: 0.625rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1rem;
  color: var(--alert-map-ink);
}

.alert05__content {
  padding: 1rem;
}

.alert05__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--alert-muted);
}

.alert05__eyebrow svg {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--alert-fg);
}

.alert05__title {
  margin-top: 0.25rem !important;
  font-size: 17px;
  line-height: 1.375;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--alert-fg);
}

.alert05__record {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem !important;
}

.alert05__row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--alert-border);
  padding-bottom: 0.5rem;
}

.alert05__row dt {
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--alert-muted);
}

.alert05__row dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--alert-fg);
}

.alert05__row dd.alert05__mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}

.alert05__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1rem;
}

.alert05__actions[hidden] {
  display: none;
}

.alert05__trust,
.alert05__secure {
  display: flex;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms,
    color 150ms;
}

.alert05__trust {
  border: 1px solid var(--alert-border-strong);
  background-color: #ffffff;
  color: var(--alert-fg);
}

.alert05__trust:hover {
  background-color: var(--alert-soft);
}

.alert05__trust[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--alert-muted);
}

.alert05__secure {
  border: 0;
  background-color: var(--alert-fg);
  color: #ffffff;
}

.alert05__secure:hover,
.alert05__secure[aria-disabled="true"] {
  background-color: var(--alert-ink-hover);
}

.alert05__secure[aria-disabled="true"] {
  cursor: progress;
}

.alert05__trust:focus-visible,
.alert05__secure:focus-visible {
  outline: 2px solid var(--alert-fg);
  outline-offset: 2px;
}

.alert05__spinner {
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid #ffffff;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: alert05-spin 700ms linear infinite;
}

.alert05__spinner[hidden] {
  display: none;
}

.alert05__outcome {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  border-radius: 0.75rem;
  background-color: var(--alert-soft);
  padding: 0.75rem;
  animation: alert05-outcome 280ms cubic-bezier(0.3, 0.8, 0.25, 1) both;
}

.alert05__outcome[hidden] {
  display: none;
}

.alert05__outcome-mark {
  display: flex;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.alert05__outcome-mark svg {
  width: 0.875rem;
  height: 0.875rem;
}

.alert05[data-outcome="trusted"] .alert05__outcome-mark {
  background-color: var(--alert-fg);
  color: var(--alert-accent);
}

.alert05[data-outcome="secured"] .alert05__outcome-mark {
  background-color: #ffffff;
  color: var(--alert-fg);
  box-shadow: inset 0 0 0 1px var(--alert-border-strong);
}

.alert05__outcome-text {
  min-width: 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.alert05__outcome-title {
  font-weight: 600;
  color: var(--alert-fg);
  outline: none;
}

.alert05__outcome-detail {
  margin-top: 0.125rem !important;
  color: var(--alert-muted);
}

.alert05__outcome-action {
  flex-shrink: 0;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  padding: 0.25rem 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--alert-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  outline: none;
}

.alert05__outcome-action[hidden] {
  display: none;
}

.alert05__outcome-action:hover {
  background-color: #ffffff;
}

.alert05__outcome-action:focus-visible {
  outline: 2px solid var(--alert-fg);
  outline-offset: 1px;
}

@keyframes alert05-land {
  from {
    box-shadow:
      0 0 0 3px var(--alert-map),
      0 0 0 18px rgba(57, 255, 20, 0);
    opacity: 0;
  }
  to {
    box-shadow:
      0 0 0 3px var(--alert-map),
      0 0 0 4px rgba(57, 255, 20, 0.55);
    opacity: 1;
  }
}

@keyframes alert05-outcome {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@container (min-width: 24rem) {
  .alert05__record {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .alert05__row {
    display: block;
    border-bottom: 0;
    padding-bottom: 0;
  }
  .alert05__row dd {
    margin-top: 0.125rem;
    text-align: left;
  }
  .alert05__actions {
    flex-direction: row;
    align-items: center;
  }
  .alert05__trust,
  .alert05__secure {
    height: 2.25rem;
  }
}

@container (min-width: 32rem) {
  .alert05__layout {
    grid-template-columns: 11.5rem minmax(0, 1fr);
  }
  .alert05__map {
    height: auto;
  }
  .alert05__content {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert05__pin,
  .alert05__outcome,
  .alert05__spinner {
    animation: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
p,
dl,
dd {
  margin: 0;
}
.alert05-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.alert05-layout__page {
  width: 100%;
  max-width: 45rem;
}
.alert05-layout__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}
.alert05-layout__heading {
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.alert05-layout__account {
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.556 0 0);
}
.alert05-layout__page .alert05 {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.alert05-layout__settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.alert05-layout__setting {
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.75rem 1rem;
}
.alert05-layout__setting dt {
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.556 0 0);
}
.alert05-layout__setting dd {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.205 0 0);
}
@media (min-width: 640px) {
  .alert05-layout {
    padding: 2.5rem;
  }
  .alert05-layout__settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
