
@layer base {
  *, ::after, ::before, ::backdrop, ::file-selector-button {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html, :host {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }
  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }
  small {
    font-size: 80%;
  }
  sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }
  sub {
    bottom: -0.25em;
  }
  sup {
    top: -0.5em;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  :-moz-focusring {
    outline: auto;
  }
  progress {
    vertical-align: baseline;
  }
  summary {
    display: list-item;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea, ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
  }
}

.text-red-600 {
  color: #dc2626;
}

.border-red-600 {
  border-color: #dc2626;
}

.focus-visible\:ring-red-600:focus-visible {
  --tw-ring-color: #dc2626;
}

.page-main {
    display: flex;
    flex: 1 1 0%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.25rem;
    box-shadow: 0 20px 30px -5px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.03);
    padding: 2.75rem 2.25rem 2.25rem 2.25rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

/* login-form.svelte / detect-company-form.svelte 共通のフォームパーツ (.login-card もしくは .auth-form-scope 配下に適用) */
.login-card form,
.auth-form-scope form {
    max-width: 100%;
    margin-top: 1.5rem;
}

.login-card form span.text-sm,
.auth-form-scope form span.text-sm {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: block;
}

.login-card form span.text-sm.text-red-600,
.auth-form-scope form span.text-sm.text-red-600 {
  color: #dc2626 !important;
}

.login-card input[data-slot="input"],
.auth-form-scope input[data-slot="input"] {
    height: 3.125rem;
    border-radius: 0.625rem;
    border-width: 1px;
    border-style: solid;
    background-color: #f8fafc;
    padding-left: 1rem;
    padding-right: 3rem;
    font-size: 1rem;
    color: #0f172a;
    transition: all 0.2s ease-in-out;
}

.login-card input[data-slot="input"]:not(.border-red-600),
.auth-form-scope input[data-slot="input"]:not(.border-red-600) {
    border-color: #cbd5e1;
}

.login-card input[data-slot="input"]:focus:not(.border-red-600),
.auth-form-scope input[data-slot="input"]:focus:not(.border-red-600) {
    background-color: #ffffff;
    border-color: #0070c0;
    box-shadow: 0 0 0 4px rgba(0, 112, 192, 0.15);
    outline: none;
}

.login-card .relative.w-full > button[data-slot="button"],
.auth-form-scope .relative.w-full > button[data-slot="button"] {
    position: absolute !important;
    right: 0.375rem !important;
    left: auto !important;
    top: 1.5625rem !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    translate: none !important;
    margin: 0 !important;
    height: 2.25rem !important;
    width: 2.25rem !important;
    color: #64748b !important;
    border-radius: 0.375rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    touch-action: manipulation !important;
}

.login-card .relative.w-full > button[data-slot="button"] svg,
.auth-form-scope .relative.w-full > button[data-slot="button"] svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.login-card .relative.w-full > button[data-slot="button"]:hover,
.auth-form-scope .relative.w-full > button[data-slot="button"]:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.login-card label[for="remember-id"],
.auth-form-scope label[for="remember-id"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
    color: #475569 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.5rem !important;
    min-height: 0 !important;
    height: auto !important;
}

.login-card label[for="remember-id"] button[data-slot="checkbox"],
.auth-form-scope label[for="remember-id"] button[data-slot="checkbox"] {
    width: 1.125rem !important;
    height: 1.125rem !important;
    min-width: 1.125rem !important;
    min-height: 1.125rem !important;
    max-width: 1.125rem !important;
    max-height: 1.125rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #cbd5e1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.login-card label[for="remember-id"] button[data-slot="checkbox"][data-state="checked"],
.auth-form-scope label[for="remember-id"] button[data-slot="checkbox"][data-state="checked"] {
    background-color: #0070c0 !important;
    border-color: #0070c0 !important;
}

.login-card button[type="submit"],
.auth-form-scope button[type="submit"] {
    height: 3.25rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #0070c0 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px rgba(0, 112, 192, 0.3);
    transition: all 0.2s ease-in-out;
    margin-top: 1.25rem;
    border: none;
}

.login-card button[type="submit"]:hover,
.auth-form-scope button[type="submit"]:hover {
    background: linear-gradient(135deg, #005fa3 0%, #0369a1 100%);
    box-shadow: 0 6px 20px rgba(0, 112, 192, 0.4);
    transform: translateY(-1px);
}

.login-card button[type="submit"]:active,
.auth-form-scope button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 112, 192, 0.25);
}

.login-card button[data-slot="button"][type="submit"],
.auth-form-scope button[data-slot="button"][type="submit"] {
    height: 3rem;
    background: #0070c0;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.625rem;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 112, 192, 0.2);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    margin-top: 0.875rem;
    letter-spacing: 0.02em;
    touch-action: manipulation;
}

.login-card button[data-slot="button"][type="submit"]:hover,
.auth-form-scope button[data-slot="button"][type="submit"]:hover {
    background-color: #005fa3;
    box-shadow: 0 6px 16px rgba(0, 112, 192, 0.35);
    transform: translateY(-1px);
}

.login-card button[data-slot="button"][type="submit"]:active,
.auth-form-scope button[data-slot="button"][type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 112, 192, 0.2);
}

.page-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    justify-content: flex-start;
    align-items: center;
    min-height: 100%;
    overflow: hidden;
    padding: 3rem 1.5rem;
    position: relative;
    width: 100%;
}

.error-page-container {
    background-color: rgb(254 242 242 / 0.9);
    border: 1px solid rgb(239 68 68 / 0.7);
    border-radius: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    max-width: 56rem;
    overflow: hidden;
    padding: 2rem;
    position: relative;
    width: 100%;
}

/* +error.svelte (404等) の新デザイン用カード */
.error-info {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
}

.error-info-wide {
    max-width: 56rem;
}

.error-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    overflow: hidden;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 3.5rem 2rem;
}

.error-content-wide {
    align-items: stretch;
    text-align: left;
    padding: 2.5rem 2rem;
}

.error-status-number {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0070c0 0%, #0284c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-content .error-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.error-content .error-page-code {
    font-size: 0.8125rem;
    color: #94a3b8;
}

.error-content .error-page-message {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

.error-content .error-page-navi {
    margin-top: 0.5rem;
}

.error-page-title {
    color: rgb(239 68 68);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 2rem;
}

.error-page-code {
  color: rgb(239 68 68);
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  line-height: 1.75rem;
}

.page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body, .page-layout {
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f1f5f9 60%, #e2e8f0 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  color: #0f172a;
  min-height: 100vh;
}

.page-header, header {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03);
  display: flex;
  gap: 0.5rem;
  min-height: 5.6rem;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .page-header, header {
    padding: 0.5rem 2rem;
  }
}

/* 「施設利用者」バッジ */
.page-header .sys-type-badge {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #0070c0 !important;
  background-color: #f0f7ff !important;
  border: 1px solid #cce3f6 !important;
  padding: 0.125rem 0.5rem !important;
  border-radius: 9999px !important;
  letter-spacing: 0.02em !important;
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  white-space: nowrap !important;
  margin-left: 0.25rem !important;
}

.page-header span.order-1 {
  transform: translateX(-0.3rem);
}

.page-header span.order-4,
.page-header span.order-2 {
  align-items: center;
}

.page-header span.order-4 > span:first-child,
.page-header span.order-2 > span:first-child {
  color: #0f172a;
}

.page-header button:has(svg.lucide-circle-help) {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: #0070c0;
  padding: 0.4rem 0.75rem;
  height: 2.375rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: all 0.15s ease-in-out;
}

.page-header button:has(svg.lucide-circle-help):hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.page-header button:has(svg.lucide-log-out) {
  background: linear-gradient(135deg, #0070c0 0%, #0284c7 100%);
  border: 1.5px solid #0070c0;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 112, 192, 0.08);
  transition: all 0.15s ease-in-out;
}

.page-header button:has(svg.lucide-log-out) span,
.page-header button:has(svg.lucide-log-out) svg {
  color: #ffffff;
}

.page-header button:has(svg.lucide-log-out):hover {
  background: linear-gradient(135deg, #005fa3 0%, #0369a1 100%);
  border-color: #0070c0;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 112, 192, 0.25);
  transform: translateY(-1px);
}

.page-header button:has(svg.lucide-log-out):hover span,
.page-header button:has(svg.lucide-log-out):hover svg {
  color: #ffffff;
}


.page-header-logo,
.page-header img,
header img {
  height: 4rem !important;
  max-height: 4rem !important;
  width: auto !important;
  object-fit: contain !important;
  transform: none !important;
}

.debug-client-addr {
  align-self: flex-start;
  color: rgb(55 65 81);
  font-size: 0.75rem;
  margin: 0 0.25rem;
}

footer, .error-page-footer {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  background-color: transparent;
  border-top: none;
  width: 100%;
}

footer div, .error-page-footer div {
  color: #64748b;
}

footer div.text-gray-300, .error-page-footer div.text-gray-300 {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 0.25rem;
}

.error-page-navi {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .error-page-navi {
    flex-direction: row;
  }
}

.error-page-table {
    background-color: rgb(255 255 255);
    caption-side: bottom;
    font-size: 0.875rem;
    width: 100%;
    border-collapse: collapse;
}

.error-page-table thead tr {
    background-color: rgb(249 250 251);
    border-bottom: 1px solid rgb(226 232 240);
}

.error-page-table thead tr th {
    color: rgb(100 116 139);
    font-weight: 500;
    padding: 0.5rem 1rem;
    text-align: center;
    vertical-align: middle;
}

.error-page-table thead tr th + th {
    border-left: 1px solid rgb(226 232 240);
}

.error-page-table tbody tr {
    border-bottom: 1px solid rgb(226 232 240);
}

.error-page-table tbody tr:last-child {
    border-bottom: 0;
}

.error-page-table tbody tr td {
    padding: 0.5rem 1rem;
    text-align: center;
    vertical-align: middle;
}

.error-page-table tbody tr td + td {
    border-left: 1px solid rgb(226 232 240);
}

.error-page-debug {
  font-size: 0.875rem;
  margin-top: 2rem;
}

.error-page-caution-button,
.error-page-outline-button {
  align-items: center;
  border-radius: 0.75rem;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  justify-content: center;
  min-height: 2.75rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.error-page-caution-button {
  background-color: rgb(249 115 22);
  color: rgb(255 255 255);
}

.error-page-caution-button:hover {
  background-color: rgb(234 88 12);
}

.error-page-outline-button {
  background-color: rgb(255 255 255);
  border: 1px solid rgb(203 213 225);
  color: rgb(51 65 85);
}

.error-page-outline-button:hover {
  background-color: rgb(248 250 252);
  border-color: rgb(148 163 184);
}

.error-page-message {
    color: rgb(71 85 105);
    font-size: 0.875rem;
    line-height: 1.75rem;
    margin-top: 1.5rem;
    max-width: 42rem;
    text-align: start;
}

.error-page-content {
    border: 1px solid rgb(226 232 240);
    border-radius: 0.375rem;
    overflow: hidden;
}

.redirect-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.redirect-loader {
    margin: 1rem;
}

.loader {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    border: 8px solid rgb(229 231 235);
    border-top-color: rgb(59 130 246);
    animation: loader-spin 1s linear infinite;
}
@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loading {
  0% {transform:rotate(0deg);}
  100% {transform:rotate(360deg);}
}

/* ダイアログ (shadcn-svelte dialog) 共通デザイン */
div[role="dialog"][data-slot="dialog-content"],
[data-slot="dialog-content"] {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  background-color: #ffffff;
}

div[data-slot="dialog-header"] {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.625rem 1.25rem;
}

div[data-slot="dialog-title"] {
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

button[data-slot="dialog-close"] {
  color: #64748b;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

button[data-slot="dialog-close"]:hover {
  color: #0f172a;
  background-color: #e2e8f0;
}

div[role="dialog"] .min-h-0 {
  padding: 1.25rem 1.5rem;
}

div[role="dialog"] .flex.items-start {
  gap: 1.125rem;
  align-items: flex-start;
}

div[role="dialog"] svg.lucide-triangle-alert {
  color: #ef4444;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  margin-top: -0.25em;
}

div[role="dialog"] p.whitespace-pre-wrap {
  color: #1e293b;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
}

div[data-slot="dialog-footer"] {
  padding: 0.375rem 1.25rem 0.5rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  background-color: #f8fafc;
}

div[data-slot="dialog-footer"]:empty {
  display: none;
}

div[data-slot="dialog-footer"] button {
  background: linear-gradient(135deg, #0070c0 0%, #0284c7 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  padding: 0.5rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 112, 192, 0.2);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

div[data-slot="dialog-footer"] button:hover {
  background: linear-gradient(135deg, #005fa3 0%, #0369a1 100%);
  box-shadow: 0 4px 10px rgba(0, 112, 192, 0.3);
  transform: translateY(-1px);
}

/* /logout 完了画面のカード */
.logout-main-wrap {
  align-items: stretch;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 100%;
  width: 100%;
}

.logout-content-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.logout-card {
  max-width: 440px;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1.25rem;
  box-shadow: 0 20px 30px -5px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.logout-card > .bg-slate-100 {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.875rem 1.5rem;
  letter-spacing: -0.01em;
}

.logout-card-title {
  text-align: center;
  font-weight: 700;
}

.logout-card > .w-full.p-4 {
  padding: 2rem;
}

.logout-card svg.lucide-circle-check-big {
  width: 3.5rem;
  height: 3.5rem;
  color: #10b981;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 0.75rem;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.logout-card p.mb-12 {
  color: #0f172a;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.logout-card .logout-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.125rem;
  width: 100%;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, #0070c0 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 112, 192, 0.28);
  transition: all 0.2s ease-in-out;
}

.logout-card .logout-close-btn:hover {
  background: linear-gradient(135deg, #005fa3 0%, #0369a1 100%);
  box-shadow: 0 6px 20px rgba(0, 112, 192, 0.38);
  transform: translateY(-1px);
  text-decoration: none;
}

.logout-card .logout-close-btn-caption {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 1em;
  margin-bottom: 1em;
}
