/* The pages for adding a server, signing in, the account area and moderation. Colors, radii and fonts come only from the theme variables (themes.css). */
.form-page { padding-block: 24px 40px; }
/* overflow-wrap is inherited: long addresses and emails wrap and do not cause horizontal scrolling */
.form-panel { max-width: 640px; margin-inline: auto; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; overflow-wrap: anywhere; }
.form-panel h1 { margin: 0; font-size: clamp(26px, 6vw, 32px); line-height: 1.15; }
.form-panel h2 { margin: 8px 0 0; font-size: 20px; line-height: 1.25; }
.form-panel p { margin: 0; }
/* The weight is set explicitly: the monospace font has only the 500 style, and in a heading the browser would draw a fake bold */
.form-panel code { padding: 2px 6px; font: 500 .9em var(--font-mono); background: var(--surface-2); border-radius: var(--radius-xs); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.form-panel h1 code { padding: 0; background: none; }
/* The user agreement and the data processing policy. Links lead to the sections, and in the dark theme the header lies over the page */
.form-panel.legal { max-width: 820px; }
.legal ul { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.legal :is(h2, h3) { scroll-margin-top: 112px; }
.legal-short { display: grid; gap: 10px; padding: 16px 18px; background: var(--surface-2); border-radius: var(--radius-md); }
.legal-short h2 { margin: 0; }
/* Purpose of processing: labels on the left, above the text on a phone */
.legal-purpose { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.legal-purpose h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.legal-purpose dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; margin: 0; }
.legal-purpose dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.legal-purpose dd { margin: 0 0 8px; }
.legal-purpose dd:last-child { margin-bottom: 0; }
@media (min-width: 640px) {
  .legal-purpose dl { grid-template-columns: 110px minmax(0, 1fr); }
  .legal-purpose dt { padding-top: 1px; }
}

/* Fields */
.form-stack, .form-field, .form-endpoint { display: grid; grid-template-columns: minmax(0, 1fr); }
.form-stack { gap: 14px; }
.form-field { gap: 6px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
/* Community links two per row: the hint in the Telegram field is long */
.form-row.form-links { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
:is(.form-panel, .mod-edit) input:not([type="radio"], [type="checkbox"], [type="hidden"]), :is(.form-panel, .mod-edit) textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 14px;
  font: 16px/1.4 var(--font-body); background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--field-edge); border-radius: var(--radius-md);
  -webkit-appearance: none; appearance: none;
}
:is(.form-panel, .mod-edit) textarea { resize: vertical; }
:is(.form-panel, .mod-edit) ::placeholder { color: var(--muted); opacity: 1; }
/* The focus outline (--focus, --focus-style) is set by the general :focus-visible rule in site.css */
:is(.form-panel, .mod-edit) :is(input, textarea):focus { border-color: var(--focus); }

/* Choice of options. The browser gives a fieldset a minimum width based on its content, which would cause scrolling */
.form-choice, .form-endpoint { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 12px; }
.form-choice legend { padding: 0; }
.form-choice label, .form-check { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
:is(.form-panel, .mod-edit) :is([type="radio"], [type="checkbox"]) { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.form-endpoint { gap: 12px; padding: 4px 14px 14px; border: var(--divider-w) solid var(--line); border-radius: var(--radius-md); }
.form-endpoint legend { margin-inline-start: -6px; padding-inline: 6px; font-weight: 600; }
/* On the add page the desktop-only fields are hidden when a phone is chosen. The server does not read these fields for a phone */
.form-stack:has([name="PlatformCode"][value="bedrock"]:checked) .java-only { display: none; }

/* Buttons and messages */
.form-actions, .form-result { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions .btn { flex: 1 1 auto; }
.form-stack > .btn, .form-actions .btn { min-height: 48px; }
.form-result > p { flex-basis: 100%; }
.form-ok, .form-errors { margin: 0; padding: 10px 14px; font-weight: 500; border-radius: var(--radius-md); }
.form-ok { background: var(--done); color: var(--done-ink); }
.form-errors { display: grid; gap: 4px; list-style: none; background: var(--red); color: var(--on-red); }

/* Lists of servers and submissions */
.form-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
/* In the moderation queue the list can be empty and would add extra spacing */
.form-list:not(:has(li)) { display: none; }
.form-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.form-list li + li { padding-top: 12px; border-top: var(--divider-w) solid var(--line); }
/* The button stays on the right while there is enough room for the text beside it, otherwise it drops to the next line */
.form-list li > div { flex: 1 1 140px; }
.form-list .note { display: block; font-size: 14px; }

/* Found servers: the panel is wider than usual so the marks about the link to the owner fit on one line.
   The marks and the message draft take the full row width */
.form-panel.discovery-panel { max-width: 880px; }
.discovery-status { display: flex; flex-wrap: wrap; flex-basis: 100%; gap: 6px; }
.discovery-status .btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.discovery-letter { flex-basis: 100%; }
.discovery-letter textarea { display: block; width: calc(100% - 28px); margin: 0 14px 14px; font-size: 15px; }

.form-details { border: var(--divider-w) solid var(--line); border-radius: var(--radius-md); }
.form-details summary { padding: 12px 14px; font-weight: 600; cursor: pointer; border-radius: var(--radius-md); }
.form-details form { padding: 0 14px 14px; }

.form-art { display: block; max-width: 100%; max-height: 280px; border-radius: var(--radius-md); }

/* On a phone the main buttons are full width, on desktop they fit their label */
@media (min-width: 640px) {
  .form-panel { padding: 32px; }
  .form-panel > .btn, .form-stack > .btn { justify-self: start; min-width: 160px; }
  .form-actions .btn { flex: none; }
}

/* Like page */
.like-head { display: flex; align-items: center; gap: 14px; }
.like-head .ava { flex: none; width: 56px; height: 56px; }
.like-head .ava img { width: 100%; height: 100%; }
.like-count { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.like-submit { justify-self: start; gap: 8px; }
.like-panel .smart-captcha { min-height: 102px; }

/* Sign-in via Yandex ID and VK ID above the email form */
.external-logins { flex-direction: column; }
.external-logins .btn { min-height: 48px; }
.form-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.form-or::before, .form-or::after { content: ""; flex: 1; border-top: var(--divider-w) solid var(--line); }
.form-signin-methods li > div { flex-basis: 180px; }

/* Profile heading with the account avatar */
.account-title { display: flex; align-items: center; gap: 12px; }
.account-title img { flex: none; width: 48px; height: 48px; object-fit: contain; }
