@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 700; font-display: swap; src: url(fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url(fonts/opensans-400.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url(fonts/opensans-600.woff2) format("woff2"); }

:root {
  --dark: #1A2740;
  --accent: #098082;
  --accent-soft: #e6f3f3;
  --text: #33415a;
  --muted: #667389;
  --line: #d6dce6;
  --bg: #f3f5f8;
  --warn: #9a4b00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Open Sans", Arial, sans-serif;
}

h1, h2 { font-family: Barlow, Arial, sans-serif; color: var(--dark); margin: 0; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; background: var(--dark); padding: 24px 32px; }
.top-logo { display: block; flex: none; max-width: 100%; height: auto; }
.top-text { min-width: 0; }
.top-out { margin-left: auto; }
.btn-link { min-height: 44px; padding: 8px 4px; background: none; border: 0; color: #fff; font: 600 14px/1.3 "Open Sans", Arial, sans-serif; text-decoration: underline; cursor: pointer; }
.top h1 { color: #fff; font-size: 28px; line-height: 1.2; }
.top p { color: #d6dce6; margin: 4px 0 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1160px;
  margin: 24px auto;
  padding: 0 24px;
  align-items: start;
}

.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.panel h2:not(:first-child) { margin-top: 24px; }
.preview-panel { position: sticky; top: 24px; min-width: 0; }

label { display: block; font-weight: 600; font-size: 13px; color: var(--dark); margin: 12px 0 4px; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input:not([type]), input[type="tel"], input[type="email"], input[type="url"], input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--dark);
  background: #fff;
}
input:focus-visible, button:focus-visible, summary:focus-visible, .file-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { min-height: 0; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hint:empty { display: none; }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.photo-tools { margin-top: 12px; }
.file-btn { display: inline-flex; margin: 0 0 12px; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.crop { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: center; }
#crop-canvas {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
}
#crop-canvas:active { cursor: grabbing; }
.shared-btn { margin-top: 12px; }
.crop-side label { margin-top: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.preview { overflow-x: auto; padding: 16px; background: #fff; border: 1px dashed var(--line); border-radius: 6px; }
.preview table { margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: 600 15px/1.3 "Open Sans", Arial, sans-serif;
  cursor: pointer;
  align-items: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #076a6c; }
.btn-secondary { background: #fff; color: var(--dark); border-color: var(--dark); }
.btn-secondary:hover { background: var(--bg); }

.status { min-height: 24px; margin: 12px 0 0; font-weight: 600; color: var(--dark); }
.status[data-kind="ok"] { color: var(--accent); }
.status[data-kind="warn"] { color: var(--warn); }

.howto { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--dark); }
.howto ul { margin: 8px 0 0; padding-left: 18px; }

.copy-source { position: fixed; left: -9999px; top: 0; }

.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 32px; }
.login-logo { display: block; width: 180px; height: auto; margin-bottom: 20px; }
.login-card h1 { font-size: 26px; line-height: 1.2; }
.login-card .btn-primary { background: #126F7A; }
.login-card .btn-primary:hover { background: #0e5a63; }
.login-card .btn { width: 100%; margin-top: 16px; }
.alert { padding: 10px 12px; border-radius: 6px; background: #fff3e6; color: var(--warn); }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; padding: 0 16px; margin: 16px auto; gap: 16px; }
  .top { padding: 20px 16px; }
  .panel { padding: 16px; }
  .preview-panel { position: static; order: -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .choice { transition: background-color .15s ease, border-color .15s ease; }
}
