:root {
  --atp-blue: #5481c1;      /* the "T" in the ATP logo */
  --bg-blue: #1f3a5f;       /* darker blue behind the characters */
  --panel: rgba(14, 30, 52, 0.88);
  --line: rgba(84, 129, 193, 0.55);
  --text-dim: #b9c9df;
  --ok: #7fd6a0;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-blue);
  color: #fff;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Logo, upper-left */
.site-header {
  position: relative;
  z-index: 2;
  padding: 16px 20px 0;
  pointer-events: none;
}

.logo-link {
  pointer-events: auto;
  display: inline-block;
  width: clamp(190px, 20vw, 270px);
}

.logo-link img {
  display: block;
  width: 100%;
  height: auto;
  /* Soft shadow keeps the logo readable over the falling characters. */
  filter: drop-shadow(0 0 6px rgba(15, 30, 50, 0.95)) drop-shadow(0 0 14px rgba(15, 30, 50, 0.8));
  transition: filter 0.25s ease;
}

.logo-link:hover img,
.logo-link:focus-visible img {
  filter:
    drop-shadow(0 0 3px rgba(0, 0, 0, 0.9))
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.85));
}

.logo-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 6px;
  border-radius: 6px;
}

/* Generator panel, centered */
.content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 16px 3rem;
  pointer-events: none; /* let the mouse reach the canvas outside the panel */
}

.panel {
  pointer-events: auto;
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.intro {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Password display */
.pw-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.pw-output {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.pw-output.empty {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(185, 201, 223, 0.6);
  user-select: none;
  -webkit-user-select: none;
}

.pw-output.fresh { animation: fresh 0.35s ease-out; }

@keyframes fresh {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Buttons */
.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: rgba(84, 129, 193, 0.25);
  border: 1px solid var(--atp-blue);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover:not(:disabled) { background: rgba(84, 129, 193, 0.45); }

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.btn-primary {
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  background: var(--atp-blue);
}

.btn-primary:hover:not(:disabled) { background: #6a94d0; }

.btn-copy {
  flex: 0 0 auto;
  min-width: 7.5rem;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
}

.btn-copy .icon-check { display: none; }
.btn-copy.copied { border-color: var(--ok); color: var(--ok); }
.btn-copy.copied .icon-copy { display: none; }
.btn-copy.copied .icon-check { display: inline; }

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .panel { padding: 1.25rem 1.1rem; }
  h1 { font-size: 1.45rem; }
  .content { min-height: calc(100vh - 90px); align-items: flex-start; }
  .btn-copy { min-width: 6.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-link img, .btn { transition: none; }
  .pw-output.fresh { animation: none; }
}
