/* BOC Flex */

:root {
  --boc-navy: #001a4b;
  --boc-blue: #0056b3;
  --boc-sky: #2196f3;
  --boc-text: #1a2340;
  --boc-muted: #4a5568;
  --boc-border: #e2e8f0;
  --boc-panel: #f2f2f2;
  --boc-white: #ffffff;
  --boc-bg: #ffffff;
  --boc-page: #ffffff;
  --boc-error: #d93025;
  --boc-otp-line: #ff8c00;
  --boc-wa: #25d366;
  --boc-arc: #c8e4f8;
  --boc-ring: #b4bddf;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --app-max: 480px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  min-height: 100dvh;
  min-height: 100svh;
  font-family: var(--font);
  background: var(--boc-bg);
  color: var(--boc-text);
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

.screen {
  display: none;
  min-height: 100dvh;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background: var(--boc-page);
  padding: calc(env(safe-area-inset-top, 0px) + 40px) 26px calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.screen.active { display: block; }

/* Shared decorative layer — all 3 screens identical */
.boc-deco-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.boc-deco {
  position: absolute;
  pointer-events: none;
}

/* Top-left: solid light-blue quarter-circle tucked in corner */
.boc-deco--arc-tl {
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  overflow: hidden;
}

.boc-deco--arc-tl::before {
  content: '';
  position: absolute;
  top: -52px;
  left: -52px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--boc-arc);
}

/* Top-right: single thick lavender hollow ring, clipped by edges */
.boc-deco--ring-tr {
  top: -58px;
  right: -58px;
  width: 188px;
  height: 188px;
  border-radius: 50%;
  border: 28px solid var(--boc-ring);
  background: transparent;
}

.boc-wrap {
  position: relative;
  z-index: 1;
  max-width: var(--app-max);
  margin: 0 auto;
}

.boc-hero {
  margin-bottom: 28px;
}

.boc-hero-title {
  font-size: clamp(1.5rem, 5vw, 1.75rem);
  font-weight: 500;
  color: var(--boc-navy);
  line-height: 1.28;
}

.boc-hero-title strong {
  display: block;
  font-weight: 800;
  font-size: clamp(1.65rem, 5.2vw, 1.95rem);
}

.boc-hero-sub {
  margin-top: 12px;
  font-size: clamp(0.9rem, 3.2vw, 0.98rem);
  color: var(--boc-text);
  line-height: 1.55;
  max-width: 340px;
  font-weight: 400;
}

.boc-greeting {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--boc-navy);
  margin-bottom: 18px;
}

.boc-form-card {
  background: var(--boc-white);
  border: 1px solid var(--boc-border);
  border-radius: 12px;
  padding: 18px 16px;
}

.boc-form-plain {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.boc-form-card--login {
  background: #f7f8fb;
  border: none;
  border-radius: 12px;
  padding: 16px 14px 18px;
}

.boc-field { margin-bottom: 16px; }
.boc-field:last-child { margin-bottom: 0; }

.boc-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--boc-text);
  margin-bottom: 8px;
}

.boc-input,
.boc-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--boc-border);
  border-radius: 8px;
  background: var(--boc-white);
  padding: 0 14px;
  font-size: 16px;
  color: var(--boc-text);
  outline: none;
}

.boc-input::placeholder { color: #a0aec0; }

.boc-input:focus,
.boc-select:focus {
  border-color: var(--boc-blue);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.boc-input-wrap { position: relative; }
.boc-input-wrap .boc-input { padding-right: 44px; }

.boc-wa-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--boc-wa);
}

.boc-pass-wrap { position: relative; }
.boc-pass-wrap .boc-input { padding-right: 44px; }

.boc-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--boc-muted);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
}

.boc-eye-btn svg { width: 20px; height: 20px; }

.boc-field.input-error .boc-input,
.boc-field.input-error .boc-select { border-color: var(--boc-error); }

.form-error {
  color: var(--boc-error);
  font-size: 0.78rem;
  margin-top: 6px;
  line-height: 1.4;
}

.boc-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--boc-blue);
  text-decoration: underline;
  text-align: right;
  width: 100%;
}

.boc-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, #25aae1 0%, #002366 100%);
  color: var(--boc-white);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  letter-spacing: 0.01em;
}

.boc-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* OTP screen — exact reference layout */
.screen--otp {
  display: none;
  flex-direction: column;
}

.screen--otp.active {
  display: flex;
}

.boc-wrap--otp {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.boc-otp-head {
  margin-bottom: 22px;
  padding-right: 40px;
}

.boc-otp-title {
  font-size: clamp(1.45rem, 5vw, 1.65rem);
  font-weight: 800;
  color: var(--boc-navy);
  line-height: 1.25;
  margin-bottom: 10px;
}

.boc-otp-sub {
  font-size: clamp(0.88rem, 3.1vw, 0.95rem);
  color: var(--boc-text);
  line-height: 1.5;
  font-weight: 400;
}

.boc-otp-panel {
  background: #f2f2f2;
  border-radius: 20px;
  padding: 20px 18px 24px;
  margin-bottom: 24px;
}

.boc-otp-panel-text {
  font-size: clamp(0.84rem, 3vw, 0.92rem);
  line-height: 1.6;
  color: var(--boc-text);
  text-align: center;
  font-weight: 500;
  margin-bottom: 24px;
}

.boc-otp-lines {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(10px, 3.5vw, 18px);
  padding: 0 4px;
}

.boc-otp-line-input {
  width: clamp(36px, 11vw, 46px);
  border: none;
  border-bottom: 3px solid var(--boc-otp-line);
  background: transparent;
  text-align: center;
  font-size: clamp(1.15rem, 4.2vw, 1.35rem);
  font-weight: 700;
  color: var(--boc-navy);
  outline: none;
  padding: 2px 0 8px;
  border-radius: 0;
}

.boc-otp-line-input:focus {
  border-bottom-color: #e67e00;
}

.boc-otp-line-input.input-error {
  border-bottom-color: var(--boc-error);
}

.boc-otp-panel .form-error {
  text-align: center;
  margin-top: 12px;
}

.boc-resend-block {
  text-align: center;
  margin-bottom: auto;
  padding-top: 4px;
}

.boc-resend-label {
  font-size: 0.88rem;
  color: var(--boc-text);
  margin-bottom: 6px;
}

.boc-resend-link {
  font-size: 0.88rem;
  color: var(--boc-blue);
  text-decoration: underline;
  font-weight: 600;
  cursor: default;
}

.boc-btn--otp {
  margin-top: 28px;
  flex-shrink: 0;
}

.user-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 16px) + 20px);
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  min-width: min(320px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: 12px;
  background: #0d7a3e;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s ease;
}

.user-toast.show { transform: translateX(-50%) translateY(0); }
.user-toast.error { background: var(--boc-error); }

@media (min-width: 600px) {
  body { background: #eef2f8; }

  .screen {
    max-width: var(--app-max);
    margin: 0 auto;
    box-shadow: 0 0 48px rgba(0, 26, 75, 0.08);
  }
}

@media (max-width: 360px) {
  .screen { padding-left: 20px; padding-right: 20px; }

  .boc-deco--ring-tr {
    width: 168px;
    height: 168px;
    top: -50px;
    right: -50px;
    border-width: 24px;
  }

  .boc-deco--arc-tl {
    width: 82px;
    height: 82px;
  }

  .boc-deco--arc-tl::before {
    width: 118px;
    height: 118px;
    top: -48px;
    left: -48px;
  }
}
