/* pycloud v0.83a — styles d'authentification et setup
   Rendu conservé depuis l'ancien socle admin, sans dépendance à admin.css. */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --app-viewport-height: 100vh;
  --bg: #f4f7fb;
  --bg-soft: #eef3f9;
  --surface: rgba(255,255,255,0.92);
  --surface-solid: #ffffff;
  --surface-muted: #f8fafc;
  --surface-raised: #ffffff;
  --border: #dbe4f0;
  --border-soft: #e8eef6;
  --text: #101827;
  --text-soft: #475569;
  --muted: #6b7a90;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0ff;
  --danger: #dc2626;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, .06);
  --shadow-lg: 0 30px 90px rgba(15, 23, 42, .22);
  --motion-duration: .3s;
  --motion-timing: linear;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}


@supports (height: 100dvh) {
  :root {
    --app-viewport-height: 100dvh;
  }
}


html,
body {
  min-height: 100%;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, .13), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--text);
}

body {
  margin: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

code {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 2px 6px;
}

button,
.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-weight: 850;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .18);
  cursor: pointer;
  white-space: nowrap;
  transition-property: background, border-color, box-shadow, color, opacity;
  transition-duration: var(--motion-duration);
  transition-timing-function: var(--motion-timing);
}

button:not(:disabled):hover,
.button-like:hover {
  background: var(--primary-hover);
  text-decoration: none;
}


button:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
}

button.secondary,
.secondary {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

button.secondary:not(:disabled):hover {
  background: var(--surface-raised);
  border-color: var(--primary);
}

input[type="text"],
input[type="number"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-solid);
  color: var(--text);
  outline: none;
  transition-property: border-color, box-shadow, background;
  transition-duration: var(--motion-duration);
  transition-timing-function: var(--motion-timing);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

label {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.login-body {
  min-height: var(--app-viewport-height);
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(480px, calc(100vw - 32px));
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.14);
  color: var(--text);
  padding: 28px;
}

.login-card h1 {
  color: var(--text);
  margin: 6px 0 8px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.small-hint {
  margin-top: 18px;
  font-size: 12px;
}

.notice {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  font-weight: 800;
}

.error-box {
  background: var(--danger-soft);
  border: 1px solid rgba(220,38,38,.25);
  color: var(--danger);
}

.settings,
.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label { display: block; }

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.password-row input[type="password"],
.password-row input[type="text"] {
  margin-top: 0;
}

.password-toggle {
  height: 42px;
  padding-inline: 12px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .password-row { grid-template-columns: 1fr; }
}

/* v0.83a — page de transition setup : handshake minimal centré */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.setup-restart-body {
  --restart-bg: #eef6ff;
  --restart-bg-soft: #fbfdff;
  --restart-endpoint-bg: linear-gradient(180deg, #ffffff, #f4f8ff);
  --restart-line: #dce8fa;
  --restart-stroke: #2e70e6;
  --restart-primary: #3178ff;
  --restart-ready: #18f26c;
  --restart-shadow: rgba(49, 120, 255, .16);
  min-height: var(--app-viewport-height);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(49, 120, 255, .16), transparent 28rem),
    radial-gradient(circle at 86% 6%, rgba(24, 242, 108, .13), transparent 24rem),
    linear-gradient(135deg, var(--restart-bg), var(--restart-bg-soft));
}

.setup-restart-shell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: var(--app-viewport-height);
}

.restart-handshake {
  width: min(270px, 74vw);
  height: 210px;
  position: relative;
}

.restart-endpoint {
  position: absolute;
  top: 72px;
  width: 82px;
  height: 82px;
  border-radius: 24px;
  border: 1px solid rgba(49, 120, 255, .2);
  background: var(--restart-endpoint-bg);
  box-shadow: 0 18px 36px var(--restart-shadow);
  display: grid;
  place-items: center;
  color: var(--restart-stroke);
  transition-property: color, border-color, box-shadow, background;
  transition-duration: var(--motion-duration);
  transition-timing-function: var(--motion-timing);
}

.restart-client { left: 0; }
.restart-server { right: 0; }

.restart-endpoint svg {
  width: 42px;
  height: 42px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.restart-link {
  position: absolute;
  left: 84px;
  right: 84px;
  top: 112px;
  height: 8px;
  border-radius: 999px;
  background: var(--restart-line);
  overflow: hidden;
  transition-property: background;
  transition-duration: var(--motion-duration);
  transition-timing-function: var(--motion-timing);
}

.restart-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(49,120,255,.5), transparent);
  opacity: .25;
}

.restart-packet {
  position: absolute;
  left: 82px;
  top: 103px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--restart-primary);
  box-shadow: 0 0 22px rgba(49, 120, 255, .42);
  opacity: 0;
}

.restart-check {
  position: absolute;
  right: 22px;
  top: 46px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(24, 242, 108, .12);
  border: 1px solid rgba(24, 242, 108, .44);
  color: #078138;
  opacity: 0;
  display: grid;
  place-items: center;
  font-weight: 1000;
  box-shadow: 0 0 26px rgba(24, 242, 108, .36);
  transition-property: opacity;
  transition-duration: var(--motion-duration);
  transition-timing-function: var(--motion-timing);
}

.restart-handshake.is-trying .restart-packet {
  animation: setupRestartPacket .75s ease-in-out 1;
}

.restart-handshake.is-trying .restart-server {
  animation: setupRestartWake .75s ease-in-out 1;
}

.restart-handshake.is-ready .restart-link {
  background: linear-gradient(90deg, rgba(24,242,108,.25), rgba(24,242,108,.75), rgba(24,242,108,.25));
}

.restart-handshake.is-ready .restart-server,
.restart-handshake.is-ready .restart-client {
  color: #078138;
  border-color: rgba(24, 242, 108, .5);
  box-shadow: 0 18px 42px rgba(24, 242, 108, .18), 0 0 24px rgba(24, 242, 108, .2);
}

.restart-handshake.is-ready .restart-check { opacity: 1; }

@keyframes setupRestartPacket {
  0% { opacity: 0; transform: translateX(0) scale(.65); }
  18% { opacity: 1; }
  78% { opacity: 1; transform: translateX(130px) scale(1); }
  100% { opacity: 0; transform: translateX(150px) scale(.7); }
}

@keyframes setupRestartWake {
  0%, 100% { filter: brightness(1); }
  60% { filter: brightness(1.18); }
}

@media (prefers-color-scheme: dark) {
  .setup-restart-body {
    --restart-bg: #07111f;
    --restart-bg-soft: #111d2f;
    --restart-endpoint-bg: linear-gradient(180deg, #16263e, #0f1d31);
    --restart-line: #243c5f;
    --restart-stroke: #7ab0ff;
    --restart-shadow: rgba(0, 0, 0, .34);
    background:
      radial-gradient(circle at 18% 12%, rgba(49, 120, 255, .18), transparent 28rem),
      radial-gradient(circle at 86% 6%, rgba(24, 242, 108, .13), transparent 24rem),
      linear-gradient(135deg, var(--restart-bg), var(--restart-bg-soft));
  }

  .restart-packet { background: #dfeeff; }
  .restart-check {
    background: rgba(24, 242, 108, .16);
    color: #8dffb8;
  }

  .restart-handshake.is-ready .restart-server,
  .restart-handshake.is-ready .restart-client {
    color: #8dffb8;
  }
}
