/* mycloud – Anmeldung, pCloud verbinden und Fehlerseite im Glas-Stil (wie myWin, myNote, myMenu).
   Immer dunkel, Akzent Gruen. Bewegung nur ueber transform und opacity, bei prefers-reduced-motion entschaerft.
   Keine Inline-Stile (CSP): alles steht hier. */

body.lg-page {
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --accent: #22c55e;
  --on-accent: #06210f;
  --lg-text: #eaf5ee;
  --lg-muted: #a9bdb1;
  --lg-danger: #ffa59c;
  --lg-bg-a: #07110c;
  --lg-bg-b: #0d1510;
  --lg-fill: rgba(16, 28, 22, .62);
  --lg-fill-top: rgba(62, 92, 76, .42);
  --lg-edge-hi: rgba(255, 255, 255, .30);
  --lg-edge-lo: rgba(255, 255, 255, .07);
  --lg-glow: rgba(255, 255, 255, .05);
  --lg-shadow: rgba(0, 0, 0, .6);
  --lg-input: rgba(6, 14, 10, .38);
  --lg-input-hover: rgba(6, 14, 10, .46);
  --lg-input-focus: rgba(6, 14, 10, .58);
  --lg-input-line: rgba(255, 255, 255, .14);
  --lg-field-line: rgba(255, 255, 255, .34);
  color-scheme: dark;
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: linear-gradient(160deg, var(--lg-bg-a), var(--lg-bg-b)) fixed;
  color: var(--lg-text);
  font: 16px/1.5 system-ui, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.lg-page * { box-sizing: border-box; }
.lg-main { width: 100%; max-width: 400px; position: relative; }
.lg-skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; z-index: 10; }
.lg-skip:focus { left: 0; }

/* Hintergrund: Foto (Schreibtisch am Fenster), ruhig, darüber ein dunkler Schleier */
.lg-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.lg-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%;
  opacity: 0; transition: opacity 900ms ease-out;
}
.lg-photo.is-loaded { opacity: 1; }
/* Schleier: macht die Mitte ruhig und den Rand dunkel, damit Text auf dem Glas lesbar bleibt */
.lg-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(6, 12, 9, .40) 0, rgba(6, 12, 9, .66) 100%); }
@media (scripting: none) { .lg-photo { opacity: 1; transition: none; } }

/* ---------- Glaskarte ---------- */
.lg-card {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 34px 28px 28px; border-radius: 28px; text-align: center; color: var(--lg-text);
  background: linear-gradient(160deg, var(--lg-fill-top), var(--lg-fill) 55%);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--lg-edge-hi), inset 0 -1px 0 var(--lg-edge-lo), inset 0 0 26px var(--lg-glow),
    0 28px 64px -14px var(--lg-shadow), 0 2px 6px rgba(0, 0, 0, .35);
}
.lg-card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; padding: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, var(--lg-edge-hi), transparent 38%, transparent 62%, var(--lg-edge-lo));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.lg-head, .lg-form, .lg-notice { position: relative; z-index: 1; }
.lg-logo { display: inline-block; border-radius: 14px; background: rgba(6, 14, 10, .5); padding: 6px; box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .18); }
.lg-head h1 { margin: .5em 0 0; font-size: 1.75rem; line-height: 1.15; letter-spacing: -.01em; }
.lg-head h1 b { color: var(--accent); font-weight: inherit; }
.lg-sub { margin: .3em 0 0; color: var(--lg-muted); }

/* ---------- Formular ---------- */
.lg-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; text-align: left; }
.lg-row label { display: block; margin: 0 0 6px 2px; font-size: .85rem; font-weight: 500; color: var(--lg-muted); }
.lg-field { position: relative; border-radius: 14px; }
.lg-field input {
  display: block; width: 100%; padding: 12px 14px; border-radius: 14px; outline: none;
  font: inherit; font-size: 1rem; color: var(--lg-text);
  background: var(--lg-input); border: 1px solid var(--lg-field-line);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.lg-field input:focus { background: var(--lg-input-focus); border-color: transparent; }
.lg-field::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--accent) 80%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
  opacity: 0; transform: scale(.985);
  transition: opacity 160ms var(--ease-out), transform 200ms var(--ease-out);
}
.lg-field:focus-within::after { opacity: 1; transform: none; }
.lg-field input:-webkit-autofill { -webkit-text-fill-color: var(--lg-text); box-shadow: inset 0 0 0 100px #14261c; caret-color: var(--lg-text); }

.lg-btn {
  position: relative; overflow: hidden; margin-top: 6px; min-height: 48px; padding: 12px 18px; border-radius: 14px; cursor: pointer;
  font: inherit; font-weight: 650; color: var(--on-accent);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 84%, #fff), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .08), 0 12px 26px -8px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform 160ms var(--ease-out), filter 140ms ease;
  -webkit-user-select: none; user-select: none;
}
.lg-btn:active { transform: scale(.97); }
.lg-btn:focus-visible { outline: 2px solid var(--lg-text); outline-offset: 3px; }
.lg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.lg-btn-quiet { color: var(--lg-text); background: rgba(6, 14, 10, .4); border-color: var(--lg-field-line); box-shadow: none; }
.lg-inline { display: inline-block; margin-right: 8px; }
.lg-btn-inline { padding: 10px 18px; margin-top: 4px; }
.lg-spin { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; opacity: 0; transition: opacity 160ms ease; }
.lg-btn[data-busy] { pointer-events: none; }
.lg-btn[data-busy] .lg-spin { opacity: 1; animation: lg-rotate 700ms linear infinite; }

@media (hover: hover) and (pointer: fine) {
  .lg-field input:hover:not(:focus) { background: var(--lg-input-hover); }
  .lg-more a:hover, .lg-doc-page a:hover { color: var(--lg-text); }
  .lg-btn:not([disabled]):hover { filter: brightness(1.07); }
}

/* ---------- Hinweise ---------- */
.lg-notice {
  margin: 20px 0 0; padding: 11px 14px; border-radius: 14px; text-align: left; font-size: .9rem; color: var(--lg-text);
  background: rgba(6, 14, 10, .42); border: 1px solid var(--lg-input-line);
  box-shadow: inset 0 1px 0 var(--lg-edge-hi);
}
.lg-notice.error { color: var(--lg-danger); border-color: color-mix(in srgb, var(--lg-danger) 55%, transparent); background: color-mix(in srgb, var(--lg-danger) 12%, rgba(6, 14, 10, .45)); animation: lg-pop 320ms var(--ease-out) 90ms both; }
.lg-notice.ok { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.lg-notice code { font-size: .88em; overflow-wrap: anywhere; }
.lg-more { margin: 16px 0 0; text-align: center; font-size: .9rem; position: relative; z-index: 1; }
.lg-more a { color: var(--lg-muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Breite Seiten (pCloud verbinden) ---------- */
body.lg-doc { place-items: start center; }
body.lg-doc .lg-main { max-width: 720px; }
.lg-doc-page { display: flex; flex-direction: column; gap: 14px; text-align: left; padding-bottom: 12px; }
.lg-doc-page h1 { margin: 2px 0 0; font-size: 1.7rem; line-height: 1.15; letter-spacing: -.01em; }
.lg-doc-page .lg-notice { margin: 0; }
.legal-sec {
  position: relative; padding: 18px 20px; border-radius: 20px;
  background: linear-gradient(160deg, var(--lg-fill-top), var(--lg-fill) 55%);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--lg-edge-hi), inset 0 -1px 0 var(--lg-edge-lo), 0 18px 44px -16px var(--lg-shadow);
}
.legal-sec h2 { margin: 0 0 8px; font-size: 1.1rem; }
.legal-sec p, .legal-sec li { margin: 0 0 .7em; line-height: 1.55; overflow-wrap: anywhere; }
.legal-sec ol { margin: 0 0 .7em; padding-left: 1.3rem; }
.legal-sec code { font-size: .88em; overflow-wrap: anywhere; }
.lg-doc-page a { color: var(--lg-text); text-underline-offset: 3px; }
.lg-back { margin: 0; }
.lg-back a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--lg-muted); }

/* ---------- Auftritt ---------- */
.lg-card:not(.is-retry) { animation: lg-card-in 560ms var(--ease-out) 60ms both; }
.lg-card:not(.is-retry) .lg-in { animation: lg-rise 440ms var(--ease-out) both; }
.lg-card:not(.is-retry) .lg-head h1 { animation-delay: 270ms; }
.lg-card:not(.is-retry) .lg-sub { animation-delay: 320ms; }
.lg-card:not(.is-retry) .lg-row:nth-of-type(1) { animation-delay: 380ms; }
.lg-card:not(.is-retry) .lg-row:nth-of-type(2) { animation-delay: 420ms; }
.lg-card:not(.is-retry) .lg-row:nth-of-type(3) { animation-delay: 460ms; }
.lg-card:not(.is-retry) .lg-btn { animation-delay: 520ms; }
.lg-card.is-retry { animation: lg-shake 440ms var(--ease-out) both; }

@keyframes lg-fade { from { opacity: 0; } }
@keyframes lg-card-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes lg-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes lg-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes lg-shake { 0%, 100% { transform: none; } 18% { transform: translateX(-9px); } 36% { transform: translateX(8px); } 54% { transform: translateX(-5px); } 72% { transform: translateX(3px); } }
@keyframes lg-rotate { to { transform: rotate(1turn); } }

@media (max-width: 420px) { .lg-card { padding: 28px 20px 22px; border-radius: 24px; } }
@media (pointer: coarse) { .lg-btn { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) {
  body.lg-page .lg-card.is-retry { animation: none !important; }
  body.lg-page .lg-card:not(.is-retry), body.lg-page .lg-card:not(.is-retry) .lg-in { animation-name: lg-fade !important; animation-duration: 240ms !important; animation-delay: 0ms !important; }
  .lg-btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  body.lg-page { --lg-fill: rgba(18, 30, 24, .95); --lg-fill-top: rgba(30, 48, 38, .96); }
  .lg-card, .legal-sec { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.lg-page { --lg-fill: rgba(18, 30, 24, .92); --lg-fill-top: rgba(30, 48, 38, .94); }
}
@media (forced-colors: active) {
  .lg-card, .legal-sec { border: 1px solid CanvasText; }
  .lg-field:focus-within { outline: 2px solid Highlight; }
}
