/* Sign-in pages (resources/views/auth/_signin.blade.php).
   --brand* come from the organization's primary colour (App\Support\OrgTheme::siteVars). */
*, *::before, *::after { box-sizing: border-box; }
:root { --ink: #0f172a; --ink-2: #475569; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc; --card: #ffffff; --danger: #b91c1c; }
html, body { margin: 0; min-height: 100%; }
body.ci-auth { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .35); outline-offset: 2px; }

.ci-auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Branding column: a centred 1:1 banner */
.ci-auth-brand { display: flex; align-items: center; justify-content: center; padding: 48px; background: linear-gradient(145deg, var(--brand-50), var(--brand-100)); }
.ci-auth-banner { width: min(100%, 560px, 78vh); aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(var(--brand-rgb), .35), 0 8px 20px -8px rgba(15, 23, 42, .18); background: #fff; }
.ci-auth-banner > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-auth-banner-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 12%;
  text-align: center; color: #fff; background: radial-gradient(circle at 25% 20%, var(--brand-400), var(--brand) 55%, var(--brand-600)); }
.ci-auth-banner-logo { max-width: 70%; max-height: 90px; object-fit: contain; background: #fff; padding: 14px 18px; border-radius: 14px; }
.ci-auth-banner-fallback p { margin: 0; font-size: 1.15rem; line-height: 1.5; font-weight: 500; max-width: 26ch; }

/* Form column */
.ci-auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 24px; background: var(--card); }
.ci-auth-card { width: 100%; max-width: 420px; }
.ci-auth-card h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 28px; letter-spacing: -.01em; color: var(--brand-600); }
.ci-auth-alert { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: .92rem; line-height: 1.45; }
.ci-auth-alert.is-info { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.ci-field { margin-bottom: 18px; }
.ci-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.ci-field input { width: 100%; height: 48px; padding: 0 14px; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.ci-field input::placeholder { color: #94a3b8; }
.ci-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .15); }
.ci-field input.is-invalid { border-color: var(--danger); }
.ci-field-error { display: block; color: var(--danger); font-size: .85rem; margin-top: 6px; }
.ci-check { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-2); margin: 4px 0 22px; cursor: pointer; }
.ci-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.ci-auth-btn { width: 100%; height: 50px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .15s, transform .05s; }
.ci-auth-btn:hover { background: var(--brand-600); }
.ci-auth-btn:active { transform: translateY(1px); }
.ci-auth-btn:disabled { opacity: .75; cursor: progress; }
.ci-auth-support { margin: 26px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: .92rem; color: var(--ink-2); line-height: 1.5; }
.ci-auth-support p { margin: 0; }
.ci-auth-support-links { margin-top: 4px !important; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ci-auth-support a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ci-auth-legal-links { margin: 18px 0 0; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); }
.ci-auth-legal-links a { text-decoration: none; font-weight: 500; }
.ci-auth-legal-links a:hover { text-decoration: underline; }

/* Privacy Policy / Terms pop-up */
.ci-legal-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); display: none; flex-direction: column; color: var(--ink); }
.ci-legal-dialog[open] { display: flex; }
.ci-legal-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.ci-legal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ci-legal-head h2 { margin: 0; font-size: 1.2rem; color: var(--brand-600); }
.ci-legal-close { border: 0; background: transparent; font-size: 1.8rem; line-height: 1; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); cursor: pointer; }
.ci-legal-close:hover { background: var(--bg); }
.ci-legal-body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; line-height: 1.65; color: var(--ink-2); font-size: .95rem; }
.ci-legal-body h2 { font-size: 1.05rem; color: var(--ink); margin: 1.4em 0 .4em; }
.ci-legal-body h3 { font-size: .98rem; color: var(--ink); margin: 1.1em 0 .3em; }
.ci-legal-body ul, .ci-legal-body ol { padding-left: 1.3rem; }
.ci-legal-date { color: var(--muted); font-size: .85rem; }
.ci-legal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.ci-legal-foot .ci-auth-btn { width: auto; height: 42px; padding: 0 22px; }
.ci-auth-legal { margin-top: auto; padding-top: 32px; font-size: .8rem; color: var(--muted); }
.ci-auth-legal a { color: var(--muted); }

/* Tablets and phones: one column, a small square banner above the form */
@media (max-width: 991.98px) {
  .ci-auth-wrap { grid-template-columns: 1fr; }
  .ci-auth-brand { padding: 28px 20px 0; background: var(--card); }
  .ci-auth-banner { width: min(58vw, 260px); border-radius: 18px; }
  .ci-auth-panel { padding: 24px 16px 20px; justify-content: flex-start; }
}
@media (max-width: 575.98px) {
  .ci-auth-banner { width: min(50vw, 180px); }
  .ci-auth-card h1 { font-size: 1.45rem; }
}
@media (max-width: 575.98px) {
  .ci-auth-card h1 { margin-bottom: 20px; }
  .ci-legal-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .ci-legal-body { padding: 14px 16px; }
  .ci-legal-foot .ci-auth-btn { width: 100%; }
}
