:root {
  --bg: #04050d;
  --bg-strong: #090c1a;
  --bg-card: rgba(15, 17, 35, 0.92);
  --bg-soft: rgba(28, 32, 64, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(99, 102, 241, 0.45);
  --primary: #6366f1;
  --accent: #22d3ee;
  --text: #f4f6ff;
  --muted: #9aa4cf;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 18px 38px rgba(6, 9, 28, 0.55);
  --font-family: "Inter", "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at top, #101538 0%, #05060f 50%, #010208 100%);
  color: var(--text);
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.home {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.home__header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.home__logo {
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.home__intro {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home__intro h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  line-height: 1.2;
}

.home__intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.home__intro code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--accent);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.tile {
  position: relative;
}

.tile__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tile__primary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.tile__primary:focus {
  outline: none;
}

.tile__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-soft);
  aspect-ratio: 1 / 1;
}

.tile__loop {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.tile__loop-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__loop-image + .tile__loop-image {
  display: none;
}

.tile__icon {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 211, 102, 0.92);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.tile__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.tile__contact:hover,
.tile__contact:focus {
  text-decoration: underline;
}

.tile__icon-glyph {
  font-size: 20px;
  line-height: 1;
}

.tile__contact-text {
  line-height: 1;
}

.tile__number {
  font-size: 0.85rem;
  color: var(--muted);
}

.tile__label {
  font-size: 0.92rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.home__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* Auth */

.auth {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
}

.auth__panel {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.auth__title {
  margin: 0;
  font-size: 1.8rem;
}

.auth__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth__error {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.92rem;
}

.auth__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth__label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth__input {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 13, 31, 0.8);
  padding: 12px;
  color: var(--text);
  font-size: 1rem;
}

.auth__input:focus {
  border-color: var(--accent);
  outline: none;
}

.auth__submit {
  align-self: flex-end;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.15);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.auth__submit:hover,
.auth__submit:focus {
  border-color: rgba(37, 211, 102, 0.6);
  color: var(--accent);
}

/* Analytics */

.analytics {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.analytics__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}

.analytics__back {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.analytics__header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.2rem);
}

.analytics__header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.analytics__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.analytics__reset-form {
  margin: 0;
}

.analytics__reset {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.analytics__reset:hover,
.analytics__reset:focus {
  border-color: var(--border-strong);
  color: var(--accent);
}

.analytics__logout-form {
  margin: 0;
}

.analytics__logout {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.analytics__logout:hover,
.analytics__logout:focus {
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
}

.analytics__content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics__empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.analytics__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(12, 16, 36, 0.72);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px 18px;
  color: var(--muted);
}

.analytics__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics__label {
  font-weight: 600;
  color: var(--text);
}

.analytics__id {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.analytics__metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.analytics__metric {
  color: var(--text);
  font-weight: 600;
}

.analytics__ratio {
  font-size: 0.9rem;
  color: var(--accent);
}

@media (min-width: 600px) {
  .page {
    max-width: 720px;
    padding: 28px 32px 48px;
  }
}
