/* ──────── Enterprise Sign-in ──────── */
/* Website look & feel: retint the auth accent to teal (design-token primary) */
.si-wrap, .si-wrap * {
  --brand-700: #1B7528; --brand-800: #12481B;
  --green-700: #1B7528; --green-800: #12481B; --green-100: #F8FFF9;
}
.si-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; background: #fff; }

/* Left brand panel */
.si-brand { background: linear-gradient(165deg, #14351C 0%, #0C2A13 55%, #0A2410 100%); color: #E7ECEA; padding: 40px 44px 36px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.si-brand::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 82% 8%, rgba(105,159,42,.16), transparent 46%), radial-gradient(circle at 6% 96%, rgba(105,159,42,.14), transparent 42%); pointer-events: none; }
.si-brand > * { position: relative; z-index: 1; }
.si-brand-top { display: flex; justify-content: space-between; align-items: center; }
.si-brand-logo { display: inline-flex; }
.si-brand-logo img { height: 50px; width: 134px; object-fit: contain; }
.si-ent-pill { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #DCE7D6; padding: 6px 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; }

/* Dashboard monitor artwork (pre-rendered transparent PNG) */
.si-brand-art { flex: 1; position: relative; margin: 8px 0 -40px; min-height: 0; }
.si-dash { position: absolute; bottom: 0; top: auto; left: -48px; width: 672px; height: 552px; display: block; object-fit: contain; filter: drop-shadow(0 40px 70px rgba(0,0,0,.5)); z-index: 0; }

/* Glassy carousel card pinned to bottom */
.si-brand-card { margin-top: auto; width: 585px; max-width: 100%; height: 339px; min-height: 0; position: relative; background: rgba(22,52,30,.28); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 44px 46px 40px; }
.si-brand-card h2 { font-family: var(--serif); font-size: 40px; width: 415px; max-width: 100%; line-height: 1.04; letter-spacing: -.02em; margin: 0 0 20px; color: #FBFDF9; animation: si-fade .5s ease; }
.si-brand-card p { font-size: clamp(15px, 1.2vw, 18px); color: #CCD8C7; line-height: 1.5; margin: 0 0 34px; max-width: 560px; animation: si-fade .5s ease; }
@keyframes si-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.si-carousel { display: flex; align-items: center; justify-content: space-between; }
.si-dots { display: flex; align-items: center; gap: 8px; }
.si-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.32); cursor: pointer; transition: width .25s ease, background .2s ease; }
.si-dots button.on { width: 40px; background: #fff; }
.si-arrows { display: flex; gap: 12px; }
.si-arrows button { width: 52px; height: 52px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); color: #EAF1E6; display: grid; place-items: center; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.si-arrows button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.55); }

/* Right form panel */
.si-form-wrap { display: flex; flex-direction: column; padding: 32px 48px 32px; position: relative; }
.si-form-top { display: flex; justify-content: space-between; align-items: center; }
.si-locale-row { display: flex; align-items: center; gap: 10px; }
.si-back-btn { position: relative; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: transparent; border: 0; color: var(--brand-700); cursor: pointer; transition: background .12s ease; }
.si-back-btn:hover { background: var(--green-100, #F1FBF2); }
.si-back-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 0; white-space: nowrap; background: var(--gray-900, #1a221c); color: #fff; font-size: 11.5px; font-weight: 500; padding: 7px 10px; border-radius: 8px; box-shadow: 0 12px 28px -10px rgba(14,22,18,.5); z-index: 30; }
.si-theme-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: transparent; border: 0; color: var(--gray-700); cursor: pointer; transition: background .12s ease; }
.si-theme-btn:hover { background: var(--gray-100); }
.si-form-top .help-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--brand-700); font-weight: 700; }
.si-form-top .help-link:hover { color: var(--brand-800); }

.si-toast-stage { position: relative; max-width: 460px; margin: 0 auto; width: 100%; padding-top: 16px; min-height: 36px; }
.si-toast { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; animation: si-toast .25s ease; }
@keyframes si-toast { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.si-toast.error { background: #FEF3F2; border: 1px solid #FECDCA; color: #912018; }
.si-toast.success { background: #ECFDF3; border: 1px solid #ABEFC6; color: #085D3A; }
.si-toast.info { background: #EFF4FF; border: 1px solid #C7D7FE; color: #1E40AF; }
.si-toast .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.si-toast.error .ic { background: #FEE4E2; color: #B42318; }
.si-toast.success .ic { background: #D1FADF; color: #079455; }
.si-toast.info .ic { background: #D1E0FF; color: #155EEF; }
.si-toast .body { flex: 1; }
.si-toast .body strong { font-weight: 700; display: block; margin-bottom: 2px; }
.si-toast .x { background: transparent; color: currentColor; opacity: .6; padding: 2px; }
.si-toast .x:hover { opacity: 1; }

/* Form card */
.si-card { max-width: 460px; margin: 24px auto auto; width: 100%; padding: 8px 0 48px; }
.si-card .back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 18px; transition: color .12s ease; }
.si-card .back:hover { color: var(--brand-700); }
.si-title { font-family: var(--serif); font-size: 36px; line-height: 1.05; letter-spacing: -.015em; margin: 0 0 8px; color: var(--text-primary); }
.si-sub { font-size: 14.5px; color: var(--gray-600); line-height: 1.55; margin: 0 0 24px; }

.si-form { display: flex; flex-direction: column; gap: 16px; }
.si-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.si-field .req { color: var(--error-600); margin-left: 2px; }
.si-input-wrap { position: relative; display: flex; align-items: center; }
.si-input-wrap > input, .si-input-wrap > select {
  width: 100%; padding: 13px 14px; background: #fff; border: 1px solid var(--gray-300);
  border-radius: 10px; font-size: 14.5px; font-family: inherit; color: var(--text-primary); outline: 0;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.si-input-wrap > input:focus, .si-input-wrap > select:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(59,124,15,.12); }
.si-input-wrap.error > input { border-color: var(--error-500); background: #FFFBFA; }
.si-input-wrap.error > input:focus { box-shadow: 0 0 0 4px rgba(217,45,32,.12); }
.si-input-wrap .toggle-pass { position: absolute; right: 12px; color: var(--gray-500); padding: 6px; }
.si-input-wrap .toggle-pass:hover { color: var(--gray-700); }
.si-field .err-text { font-size: 12px; color: var(--error-600); font-weight: 600; margin-top: 5px; display: flex; align-items: center; gap: 5px; }

/* Inline row helpers */
.si-row { display: flex; justify-content: space-between; align-items: center; }
.si-link { font-size: 13px; color: var(--brand-700); font-weight: 700; text-decoration: underline; }
.si-link:hover { color: var(--brand-800); }
.si-cta { width: 100%; justify-content: center; padding: 14px 20px; font-size: 14.5px; }
.si-cta:disabled, .si-cta[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }

.si-divider { display: flex; align-items: center; gap: 14px; color: var(--gray-500); font-size: 12px; font-weight: 600; margin: 22px 0; }
.si-divider::before, .si-divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }

.si-sso-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.si-sso-btn { padding: 11px 12px; background: #fff; border: 1px solid var(--gray-300); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.si-sso-btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.si-sso-btn svg { color: var(--gray-700); }

.si-footnote { font-size: 12.5px; color: var(--gray-500); text-align: center; margin-top: 26px; line-height: 1.5; }
.si-footnote a { color: var(--brand-700); font-weight: 600; }
.si-footnote a:hover { text-decoration: underline; }

/* OTP boxes */
.si-otp-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0; max-width: 320px; margin-left: auto; margin-right: auto; }
.si-otp-row input {
  width: 100%; aspect-ratio: 1; padding: 0; background: #fff;
  border: 1.5px solid var(--gray-300); border-radius: 12px;
  text-align: center; font-size: 30px; font-weight: 700; color: var(--text-primary);
  outline: 0; font-family: inherit; transition: border-color .12s ease, box-shadow .12s ease;
}
.si-otp-row input:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(59,124,15,.12); }
.si-otp-row.error input { border-color: var(--error-500); color: var(--error-600); background: #FFFBFA; }
.si-otp-resend { text-align: center; font-size: 13px; color: var(--gray-600); margin-top: 12px; }
.si-otp-resend a { color: var(--brand-700); font-weight: 700; }

/* Password rules */
.si-rules { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.si-rules .r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-600); }
.si-rules .r.ok { color: var(--success-600); }
.si-rules .r .ic { width: 16px; height: 16px; border-radius: 50%; background: var(--gray-200); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: background .12s ease; }
.si-rules .r.ok .ic { background: var(--success-500); }
.si-rules .r .ic svg { width: 10px; height: 10px; }

.si-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--gray-700); line-height: 1.5; cursor: pointer; padding: 8px 0; user-select: none; }
.si-checkbox input { display: none; }
.si-checkbox .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--gray-400); display: grid; place-items: center; transition: all .12s ease; flex-shrink: 0; margin-top: 1px; }
.si-checkbox input:checked + .box { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.si-checkbox .box svg { opacity: 0; transition: opacity .12s ease; }
.si-checkbox input:checked + .box svg { opacity: 1; }

/* Loader screen */
.si-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; padding: 32px; text-align: center; }
.si-loader .spin { width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--gray-200); border-top-color: var(--green-700); animation: si-spin 1s linear infinite; margin: 0 auto 24px; }
.si-loader.success-pop .spin { display: none; }
.si-loader.success-pop .check-pop { width: 72px; height: 72px; border-radius: 50%; background: var(--success-50); color: var(--success-600); display: grid; place-items: center; margin: 0 auto 24px; border: 4px solid #D1FADF; animation: si-pop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes si-spin { to { transform: rotate(360deg); } }
@keyframes si-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.si-loader h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; letter-spacing: -.01em; }
.si-sso-btn { position: relative; }
.si-sso-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 0; width: 240px; background: var(--gray-900, #1a221c); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.5; padding: 10px 12px; border-radius: 10px; box-shadow: 0 12px 28px -10px rgba(14,22,18,.5); z-index: 20; text-align: left; }
.si-success-icon { position: relative; width: 78px; height: 72px; margin: 0 auto 22px; }
.si-success-card { position: absolute; border-radius: 14px; display: grid; place-items: center; }
.si-success-card.back { inset: 0 0 8px 14px; background: linear-gradient(150deg, #1f5d16, #3b7c0f); transform: rotate(8deg); opacity: .85; }
.si-success-card.front { inset: 8px 14px 0 0; background: linear-gradient(150deg, #eef7e7, #d9ecc9); color: var(--green-700); box-shadow: 0 8px 20px -8px rgba(20,60,20,.4); animation: si-pop .4s cubic-bezier(.34,1.56,.64,1); }
.si-success-bar { width: 260px; max-width: 80%; height: 6px; border-radius: 999px; background: var(--green-100, #e3f0d5); margin: 22px auto 0; overflow: hidden; }
.si-success-bar i { display: block; height: 100%; width: 60%; border-radius: 999px; background: var(--green-700, #2f6b18); animation: si-progress 2.2s ease-in-out infinite; }
@keyframes si-progress { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(180%); } }
.si-success-cancel { margin-top: 18px; border: 0; background: transparent; color: var(--green-700); font-family: inherit; font-size: 13.5px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.si-success-cancel:hover { color: var(--green-800, #2c5e14); }
@media (prefers-reduced-motion: reduce) { .si-success-bar i { animation: none; width: 70%; } }

/* Dev step picker (demo aid) */
.si-stepper-dev { position: fixed; bottom: 20px; right: 20px; background: rgba(14,22,18,.95); color: #fff; padding: 10px; border-radius: 12px; backdrop-filter: blur(8px); display: flex; gap: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.3); z-index: 100; flex-wrap: wrap; max-width: 360px; }
.si-stepper-dev .label { font-size: 10px; font-weight: 800; color: #94A3A0; letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; align-self: center; }
.si-stepper-dev button { padding: 6px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; color: #BFC9C2; background: rgba(255,255,255,.05); transition: background .12s ease, color .12s ease; }
.si-stepper-dev button:hover { background: rgba(255,255,255,.1); color: #fff; }
.si-stepper-dev button.on { background: var(--green-700); color: #fff; }

/* Responsive */
@media (max-width: 980px) {
  .si-wrap { grid-template-columns: 1fr; }
  .si-brand { padding: 28px 24px 24px; }
  .si-brand-art { min-height: 380px; margin-top: 16px; }
  .si-brand-card { padding: 32px 28px 28px; }
  .si-brand-card h2 { font-size: clamp(30px, 8vw, 46px); }
  .si-brand-card p { font-size: 15px; }
  .si-form-wrap { padding: 24px 24px 32px; }
  .si-stepper-dev { left: 12px; right: 12px; bottom: 12px; max-width: none; justify-content: center; }
}
@media (max-width: 480px) {
  .si-otp-row { gap: 8px; max-width: 280px; }
  .si-otp-row input { font-size: 24px; border-radius: 10px; }
  .si-title { font-size: 28px; }
  .si-sso-row { grid-template-columns: 1fr; }
}

/* ── Dark mode ── */
[data-theme="dark"] .si-wrap { background: var(--bg-primary); }
[data-theme="dark"] .si-brand { background: #050708; }
[data-theme="dark"] .si-form-wrap { background: var(--bg-primary); }
[data-theme="dark"] .si-title { color: var(--text-primary); }
[data-theme="dark"] .si-sub, [data-theme="dark"] .si-card .back { color: var(--gray-600); }
[data-theme="dark"] .si-field label { color: var(--text-primary); }
[data-theme="dark"] .si-input-wrap > input, [data-theme="dark"] .si-input-wrap > select, [data-theme="dark"] .si-otp-row input { background: #14191F; border-color: var(--gray-300); color: var(--text-primary); }
[data-theme="dark"] .si-input-wrap > input::placeholder { color: var(--gray-500); }
[data-theme="dark"] .si-input-wrap > input:focus, [data-theme="dark"] .si-input-wrap > select:focus, [data-theme="dark"] .si-otp-row input:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(143,184,113,.18); }
[data-theme="dark"] .si-input-wrap.error > input, [data-theme="dark"] .si-otp-row.error input { background: rgba(244,115,115,.05); border-color: var(--error-500); }
[data-theme="dark"] .si-divider { color: var(--gray-500); }
[data-theme="dark"] .si-divider::before, [data-theme="dark"] .si-divider::after { background: var(--gray-200); }
[data-theme="dark"] .si-sso-btn { background: #14191F; border-color: var(--gray-300); color: var(--text-primary); }
[data-theme="dark"] .si-sso-btn:hover { background: var(--gray-100); border-color: var(--gray-400); }
[data-theme="dark"] .si-rules { background: #11161B; border-color: var(--gray-200); }
[data-theme="dark"] .si-rules .r { color: var(--gray-600); }
[data-theme="dark"] .si-rules .r.ok { color: var(--success-600); }
[data-theme="dark"] .si-checkbox { color: var(--gray-700); }
[data-theme="dark"] .si-toast.error { background: rgba(244,115,115,.08); border-color: rgba(244,115,115,.3); color: #FFB0B0; }
[data-theme="dark"] .si-toast.success { background: rgba(74,191,133,.08); border-color: rgba(74,191,133,.3); color: var(--success-600); }
[data-theme="dark"] .si-toast.info { background: rgba(96,144,255,.08); border-color: rgba(96,144,255,.3); color: #96B5FF; }
[data-theme="dark"] .si-footnote { color: var(--gray-500); }
[data-theme="dark"] .si-loader h2 { color: var(--text-primary); }
[data-theme="dark"] .si-loader p { color: var(--gray-600); }
[data-theme="dark"] .si-loader .spin { border-color: var(--gray-200); border-top-color: var(--green-700); }
[data-theme="dark"] .si-form-top .help-link { color: var(--gray-600); }
