/*
 * rdt-login.css - Rimo login page in the rimo-desktop "Papier modern" look
 * (AuthLayout / AuthBrandPanel / LoginPage on main, 2026-10-09).
 */

:root {
  color-scheme: light;
  --page: #f1f2f4;
  --card: #ffffff;
  --ink: #111316;
  --muted: #464a51;
  --subtle: #5d626a;
  --line: #e3e5e8;
  --line-strong: #cfd2d7;
  --field: #f6f7f8;
  --field-border: #757a82;
  --hover: #f2f3f5;
  --brand: #3f6212;
  --brand-hover: #34520f;
  --brand-ink: #ffffff;
  --focus: #4d7c0f;
  --ring: rgba(132, 204, 22, 0.4);
  --link: #3f6212;
  --error: #c41e1e;
  --warning: #b45309;
  --shadow: 0 0 0 1px rgba(15, 20, 30, 0.07), 0 1px 2px rgba(15, 20, 30, 0.05), 0 8px 24px -10px rgba(15, 20, 30, 0.14);
  --shadow-flat: 0 0 0 1px rgba(15, 20, 30, 0.07), 0 1px 2px rgba(15, 20, 30, 0.04);
  --shadow-dialog: 0 0 0 1px rgba(15, 20, 30, 0.08), 0 32px 64px -20px rgba(15, 20, 30, 0.35);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.12);
  --btn-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 16px -6px rgba(63, 98, 18, 0.35);
  --panel-bg: #e1e6cf;
  --panel-ink: var(--ink);
  --panel-accent: #3f6212;
  --panel-line: #4d7c0f;
  --panel-glow: #f7f9ef;
  --panel-glow-opacity: 0.7;
  --tile-bg: #3f6212;
  --notice-bg: #f2f7ec;
  --notice-border: #d5e6c4;
  --notice-ink: #2d5510;
  --env-ink: #b45309;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0d;
  --card: #181816;
  --ink: #f2f1ec;
  --muted: #a9a79f;
  --subtle: #8c8a82;
  --line: #2a2925;
  --line-strong: #3b3e36;
  --field: #211f1c;
  --field-border: #77766e;
  --hover: #23221f;
  --brand: #c4f04d;
  --brand-hover: #d2f56f;
  --brand-ink: #141510;
  --focus: #c4f04d;
  --ring: rgba(196, 240, 77, 0.25);
  --link: #c4f04d;
  --error: #f87171;
  --warning: #f5a524;
  --shadow: 0 0 0 1px rgba(255, 250, 235, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 36px -10px rgba(0, 0, 0, 0.7);
  --shadow-flat: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(255, 250, 235, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-dialog: 0 0 0 1px rgba(255, 250, 235, 0.06), 0 32px 64px -20px rgba(0, 0, 0, 0.85);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --btn-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px -4px rgba(196, 240, 77, 0.28);
  --panel-bg: #0a1407;
  --panel-ink: #e8f2de;
  --panel-accent: #c4f04d;
  --panel-line: #a3e635;
  --panel-glow: #3d7514;
  --panel-glow-opacity: 0.45;
  --notice-bg: #18240f;
  --notice-border: #2f4520;
  --notice-ink: #c3e5a3;
  --env-ink: #f5a524;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body.rdt-auth {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: -0.011em;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rdt-visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  margin: -1px !important; padding: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* environment: 3px strip + pill beside the title (auth.md 12.1) */
.rdt-env-strip { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 20; background: var(--env-ink); }
.rdt-env-strip[hidden] { display: none; }
.rdt-env-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--env-ink);
  border-radius: 9999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--env-ink) 45%, transparent);
  background: color-mix(in srgb, var(--env-ink) 8%, transparent);
}
.rdt-env-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--env-ink); }
.rdt-env-pill[hidden] { display: none; }

/* ── frame: 50:50 split from 1024px ───────────────────────────────────── */
.rdt-auth-grid { display: grid; min-height: 100vh; }
@media (min-width: 1024px) { .rdt-auth-grid { grid-template-columns: 1fr 1fr; } }

.rdt-auth-main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0;
  padding: 48px 16px 32px;
}
.rdt-auth-center { display: flex; justify-content: center; width: 100%; }
.rdt-auth-card {
  display: flex; flex-direction: column; gap: 24px;
  width: 100%; max-width: 400px;
  margin: 0;
  padding: 32px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: rdt-page-in 260ms ease-out both;
}
@media (min-width: 1024px) {
  .rdt-auth-main { justify-content: space-between; padding: 40px 32px 28px; background: var(--card); }
  .rdt-auth-center { flex: 1; align-items: center; }
  .rdt-auth-card { padding: 0; background: transparent; border-radius: 0; box-shadow: none; }
  .rdt-auth-tile-narrow { display: none; }
}
@keyframes rdt-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.rdt-brand-tile {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--tile-bg);
}
.rdt-brand-tile img { width: 24px; height: auto; }

/* ── heading ──────────────────────────────────────────────────────────── */
.rdt-auth-heading { display: flex; flex-direction: column; gap: 4px; }
.rdt-auth-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rdt-auth-heading h1 {
  margin: 0;
  font-size: 22.5px; font-weight: 600; line-height: 1.25;
  letter-spacing: -0.02em;
}
.rdt-auth-heading p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ── fields ───────────────────────────────────────────────────────────── */
.rdt-auth-fields { display: flex; flex-direction: column; gap: 18px; }
.rdt-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.rdt-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rdt-field label { font-size: 13px; font-weight: 500; color: var(--ink); }
.rdt-link { font-size: 13px; font-weight: 500; color: var(--link); text-decoration: none; border-radius: 4px; }
.rdt-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.rdt-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.rdt-input {
  position: relative;
  display: flex; align-items: center;
  height: 44px;
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.rdt-input:hover { border-color: var(--ink); }
.rdt-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.rdt-input input {
  flex: 1; min-width: 0;
  height: 42px;
  padding: 0 14px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 0; outline: none;
}
.rdt-input input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 0s 600000s, color 0s 600000s;
}
.toggle-password {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-right: 4px;
  background: none; border: 0; border-radius: 10px;
  color: var(--muted); font-size: 13px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.toggle-password:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.toggle-password:disabled { opacity: 0.5; cursor: default; }
.toggle-password:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.rdt-capslock { position: absolute; right: 0; top: 2px; font-size: 11px; font-weight: 600; color: var(--warning); opacity: 0; pointer-events: none; }

/* ── primary button ───────────────────────────────────────────────────── */
.rdt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; width: 100%;
  margin-top: 6px;
  padding: 0 20px;
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.rdt-btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--btn-shadow); }
.rdt-btn-primary:hover { background: var(--brand-hover); box-shadow: var(--btn-shadow-hover); }
.rdt-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.rdt-btn[aria-busy="true"] { opacity: 0.8; cursor: progress; }
.rdt-spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: rdt-spin 700ms linear infinite; }
.rdt-btn[aria-busy="true"] .rdt-spinner { display: inline-block; }
@keyframes rdt-spin { to { transform: rotate(360deg); } }

.rdt-auth-error {
  display: none;
  padding: 10px 12px;
  font-size: 13px; line-height: 1.45;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 7%, var(--card));
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
  border-radius: 10px;
  animation: rdt-shake 260ms ease-out;
}
.rdt-auth-error a { color: inherit; }
@keyframes rdt-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.rdt-auth-more { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: -6px; }
.rdt-quiet-link, .rdt-quiet-link a { font-size: 13px; color: var(--muted); text-decoration: none; }
.rdt-quiet-link:hover, .rdt-quiet-link a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rdt-quiet-link:empty { display: none; }

/* ── announcements ────────────────────────────────────────────────────── */
.rdt-announcements:empty, .rdt-panel-announcements:empty { display: none; }
.rdt-announcements, .rdt-panel-announcements {
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow-flat);
  overflow: hidden;
}
.SDLoginInfoBoxWrapper { padding: 12px 14px; color: var(--ink); }
.SDLoginInfoBoxWrapper + .SDLoginInfoBoxWrapper { border-top: 1px solid var(--line); }
.SDLoginBoxHeader { margin: 0 0 2px; font-size: 13px; font-weight: 600; }
.SDLoginSplitline, .SDLoginEndOfDiv { display: none; }
.SDLoginInfo { display: flex; gap: 10px; align-items: flex-start; }
.SDLoginInfoAlertIcon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; background-size: contain; background-repeat: no-repeat; }
.SDLoginInfoText { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.SDLoginInfoText a { color: var(--link); font-weight: 500; }

/* ── footer ───────────────────────────────────────────────────────────── */
.rdt-auth-footer { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 400px; margin-top: 24px; color: var(--muted); }
.rdt-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 13px; }
.rdt-footer-links a { color: var(--muted); text-decoration: none; }
.rdt-footer-links a:hover { color: var(--ink); }
.rdt-footer-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.rdt-toggle {
  display: inline-flex; gap: 2px;
  padding: 2px;
  background: var(--field);
  border-radius: 9999px;
}
.rdt-toggle button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 22px; min-width: 32px; padding: 0 10px;
  font: inherit; font-size: 12px;
  color: var(--muted);
  background: transparent; border: 0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.rdt-toggle button:hover { color: var(--ink); }
.rdt-toggle button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-flat); cursor: default; }
.rdt-toggle button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.rdt-version { margin-left: 4px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ── brand panel (left half) ──────────────────────────────────────────── */
.rdt-brand-panel { display: none; }
@media (min-width: 1024px) {
  .rdt-brand-panel {
    position: relative; order: -1;
    display: flex; flex-direction: column; justify-content: space-between;
    overflow: hidden;
    padding: 40px 48px;
    background: var(--panel-bg);
    color: var(--panel-ink);
  }
}
.rdt-brand-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.rdt-glow-a { stop-color: var(--panel-glow); stop-opacity: var(--panel-glow-opacity); }
.rdt-glow-b { stop-color: var(--panel-glow); stop-opacity: 0; }
.rdt-draw { stroke: var(--panel-line); }
.rdt-dots-fill { fill: var(--panel-line); }
.rdt-wordmark { position: relative; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.rdt-brand-foot { position: relative; display: flex; flex-direction: column; gap: 28px; }
.rdt-headline {
  margin: 0; max-width: 480px;
  font-size: clamp(32px, 3.4vw, 44px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em;
  text-wrap: balance;
}
.rdt-headline-accent { color: var(--panel-accent); }
.rdt-panel-announcements { max-width: 480px; }

.rdt-draw path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: rdt-draw 1.6s cubic-bezier(0.3, 0.7, 0.3, 1) forwards; }
.rdt-draw path:nth-child(2) { animation-delay: 0.15s; }
.rdt-draw path:nth-child(3) { animation-delay: 0.3s; }
.rdt-draw path:nth-child(4) { animation-delay: 0.45s; }
.rdt-draw path:nth-child(5) { animation-delay: 0.6s; }
.rdt-draw path:nth-child(6) { animation-delay: 0.75s; }
.rdt-draw-dots circle { opacity: 0; animation: rdt-dot 0.4s ease-out 1.2s forwards; }
.rdt-pulse { transform-box: fill-box; transform-origin: center; animation: rdt-pulse 2.4s ease-out 2 forwards; }
@keyframes rdt-draw { to { stroke-dashoffset: 0; } }
@keyframes rdt-dot { to { opacity: 1; } }
@keyframes rdt-pulse { from { transform: scale(0.6); opacity: 0.5; } to { transform: scale(2.4); opacity: 0; } }

/* ── overlays: password reset / session reset as rimo-desktop dialogs ── */
.overlay-bg, .overlay-session-bg {
  display: none;
  position: fixed !important; inset: 0;
  height: 100% !important; width: 100%;
  z-index: 1000; cursor: default;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
.overlay-content, .overlay-session-content {
  position: relative;
  top: 14vh !important; left: auto !important;
  margin: 0 auto !important;
  width: min(440px, calc(100% - 32px)) !important;
  padding: 28px 24px 80px !important;
  font-size: 14px; line-height: 1.5;
  color: var(--ink);
  background: var(--card);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-dialog);
  animation: rdt-page-in 200ms ease-out both;
}
.overlay-content p, .overlay-session-content p { margin: 0 0 6px; color: var(--muted) !important; }
.overlay-content p[style*="font-size:16px"],
.overlay-content > div > p:first-child { color: var(--ink) !important; font-size: 17px !important; font-weight: 600; letter-spacing: -0.01em; }
.overlay-content br + br, .overlay-session-content br + br { display: none; }
.overlay-session-content h3 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.overlay-content input[type="text"], .overlay-content input[type="password"],
.overlay-session-content input[type="text"], .overlay-session-content input[type="password"],
.overlay_reset_username {
  width: 100%;
  height: 44px !important;
  margin: 6px 0 10px;
  padding: 0 14px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-border) !important;
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.overlay-content input:focus, .overlay-session-content input:focus { border-color: var(--focus) !important; box-shadow: 0 0 0 3px var(--ring); }
.overlay-session-content .SDLoginInputField label, .overlay-session-content .SDLoginHint { display: none; }
.close-btn, .submit-btn, .close-session-btn, .submit-session-btn {
  position: absolute !important;
  bottom: 22px !important;
  width: auto !important; min-width: 104px;
  height: 40px;
  padding: 0 16px !important;
  font: inherit; font-size: 14px; font-weight: 600;
  border-radius: 10px !important;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.submit-btn, .submit-session-btn { right: 24px !important; left: auto !important; background: var(--brand) !important; color: var(--brand-ink) !important; border: 0 !important; box-shadow: var(--btn-shadow); }
.submit-btn:hover, .submit-session-btn:hover { background: var(--brand-hover) !important; box-shadow: var(--btn-shadow-hover); }
.close-btn, .close-session-btn { right: 140px !important; left: auto !important; background: var(--card) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.close-btn.left, .close-session-btn.left { right: 24px !important; }
.close-btn:hover, .close-session-btn:hover { background: var(--hover) !important; border-color: var(--line-strong) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rdt-draw path { stroke-dashoffset: 0; }
  .rdt-draw-dots circle { opacity: 1; }
  .rdt-pulse { opacity: 0; }
}
@media (min-width: 1024px) { .rdt-auth-card > .rdt-announcements { display: none; } }
