/* Responsive security-alert demo
   Шрифты подключаются в css/fonts.css (самохостинг, без Google Fonts). */
:root {
  color-scheme: light;
  --font: "Google Sans Flex", "Onest", "Google Sans Flex Fallback",
          system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: #f1f4f9;
  --surface: #fff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e3e6eb;
  --icon: #687078;
  --blue: #2f6bd6;
  --blue-hover: #2859b8;
  --focus: #8ab4f8;
  --card-radius: 1.75rem;
  --mark: 2.75rem;
  --mark-gap: 1.5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --page-top: clamp(1.5rem, 7vh, 4.5rem);

  font-family: var(--font);
  font-synthesis: none;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: max(var(--page-top), env(safe-area-inset-top));
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.alert-card {
  width: min(100%, 52.25rem);
  min-height: 30.5rem;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 3.25rem);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: 0 1px 2px rgb(35 50 75 / 2%);
}

.intro { min-width: 0; }
.brand-mark {
  display: flex;
  align-items: center;
  margin: 0 0 var(--mark-gap) 0;
}
.zerion-logo {
  display: block;
  width: auto;
  height: 1.75rem;          /* ~28px */
  color: #3232DC;           /* Zerion brand blue */
  /* SVG uses currentColor */
  filter: none;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.3rem + 1.2vw, 2rem);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.intro-copy {
  max-width: 32ch;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.details {
  min-width: 0;
  padding-top: 1.75rem;   /* lower the whole permissions + buttons block */
  display: flex;
  flex-direction: column;
}

/* Permission list with blue scope icons */
.permission-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.permission-item {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.permission-item:first-child {
  padding-top: 0;
}

.permission-item:last-child {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

.permission-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.scope-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 0.1rem;
  display: block;
}

.permission-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink);
}

.access-link {
  display: inline-block;
  margin-top: 0.15rem;
  color: var(--blue);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: default;
  user-select: none;
}

/* Keep visual style, no navigation */
.access-link:hover {
  text-decoration: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: auto;
}

.button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem clamp(1rem, 2vw, 1.375rem);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .9375rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: .005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .18s ease;
}
.button:active { transform: translateY(1px); }
.button:focus-visible, a:focus-visible, .language:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.button-secondary {
  color: var(--blue);
  background: #fff;
  border-color: #dadce0;
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.button-primary {
  flex: 0 0 auto;
  min-width: 6.5rem;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}
.button:disabled { cursor: default; opacity: .75; transform: none; }

.feedback {
  min-height: 1.25rem;
  margin: .8125rem 0 0;
  color: #3c6f49;
  font-size: .875rem;
  line-height: 1.45;
  text-align: right;
}

.footer {
  width: min(100%, 48.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1.25rem;
  margin-top: 1.25rem;
  padding: 0 .125rem;
  color: #30343a;
  font-size: .8125rem;
}
.lang-wrap {
  position: relative;
}
.language {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  cursor: pointer;
}
.lang-menu {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  min-width: 11.5rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgb(32 40 60 / 12%);
}
.lang-menu[hidden] { display: none; }
.lang-menu li {
  padding: 0.55rem 0.9rem;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.lang-menu li:hover,
.lang-menu li[aria-selected="true"] {
  background: #f1f4f9;
}
.chevron {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: var(--icon);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 0 clamp(1.125rem, 3vw, 2rem); }
.footer a,
.footer-link {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  cursor: default;
  user-select: none;
}


/* Hover only where it exists */
@media (hover: hover) {
  .button-secondary:hover { background: #f8faff; border-color: #cbd8ef; }
  .button-primary:hover { background: var(--blue-hover); }
  .footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* Larger touch targets */
@media (pointer: coarse) {
  .button { min-height: 3rem; }
  .language, .footer a { min-height: 2.75rem; }
}

/* Tablets and small windows: single column */
@media (max-width: 760px) {
  .page { --page-top: clamp(1.75rem, 6vh, 3.375rem); justify-content: flex-start; }
  .alert-card {
    width: min(100%, 37.5rem);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: clamp(1.625rem, 5vw, 2.25rem);
  }
  .brand-mark { margin-bottom: 1.25rem; }
  .details { padding-top: 0.75rem; }
  .permission-list { margin-bottom: 1.5rem; }
  .actions { justify-content: flex-start; }
  .feedback { text-align: left; }
  .footer { width: min(100%, 37.5rem); }
}

/* Phones */
@media (max-width: 480px) {
  .page { --gutter: .875rem; --page-top: 1.125rem; }
  .alert-card {
    gap: 1rem;
    padding: 1.5rem 1.375rem 1.375rem;
    border-radius: 1.375rem;
  }
  .brand-mark { margin-bottom: 1.125rem; }
  h1 { font-size: 1.375rem; }
  .permission-item { padding: 0.75rem 0; }
  .permission-text { font-size: 0.875rem; }
  .actions { flex-direction: column-reverse; align-items: stretch; gap: .625rem; }
  .button { width: 100%; min-height: 3rem; padding-inline: 1rem; }
  .button-primary { flex: 0 0 auto; }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-top: 1rem;
    padding-inline: .375rem;
  }
  
}

/* Narrow screens */
@media (max-width: 359px) {
  .page { --gutter: .625rem; }
  .alert-card { padding: 1.25rem 1rem 1.125rem; }
  .footer nav { column-gap: 1.125rem; }
}

/* Short landscape */
@media (max-height: 560px) and (min-width: 560px) {
  .page { --page-top: .75rem; justify-content: flex-start; }
  .alert-card {
    width: min(100%, 52.25rem);
    min-height: 0;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1.75rem;
    padding: 1.5rem 1.75rem;
  }
  .brand-mark { --mark-gap: 1rem; margin-bottom: var(--mark-gap); }
  .details { padding-top: 1rem; }
  .permission-list { margin-bottom: 1.25rem; }
  .footer { width: min(100%, 52.25rem); }
}

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