/* Stone Surgeons CRM — the glassy authenticator-code boxes (crm/otp.js, Nov 22 2026, v143).
   The "Glassy OTP" reel Steve sent, in the website's colours: navy #0b2a4a / ink #071a2e, teal #2a9d8f, blue #1f6fd0,
   mint #b9efe6. Glass = see-through white layers with a bright top edge over soft colour light. NO backdrop blur: the
   CRM's no-blur rule (glass.css) stays, so phones never go black. This file is the CRM's one glassy place, on purpose.
   .auth.auth-otp   the sign-in's two-step screen: the form side becomes a navy scene and the card turns to glass
   .otp.otp-stage   inside a CRM page: the boxes on their own small navy panel */

.otp {
  --otp-scene:
    radial-gradient(42% 38% at 18% 22%, rgba(42, 157, 143, .55), transparent 72%),
    radial-gradient(38% 34% at 84% 78%, rgba(31, 111, 208, .55), transparent 72%),
    radial-gradient(30% 26% at 72% 12%, rgba(185, 239, 230, .28), transparent 72%),
    linear-gradient(160deg, #0b2a4a 0%, #071a2e 100%);
  --g: 10px;
  --w: 46px;                                            /* otp.js sets it from the width: 36 to 54 px */
  --ok: #34c47c; --ok-d: #1d7a4f; --bad: #ff7a72;
  color: #e8f0f8; margin: 2px 0 14px;
}
.otp.otp-stage { background: var(--otp-scene); border-radius: 16px; padding: 20px 14px 10px; border: 1px solid rgba(11, 42, 74, .25); }

/* the six boxes, with the real input lying over them */
.otp-field { position: relative; min-width: 0; }   /* the boxes may shrink: the card never grows past the screen */
.otp-row { display: flex; justify-content: center; gap: var(--g); }
.otp-box {
  position: relative; flex: 0 1 var(--w); min-width: 0; height: calc(var(--w) * 1.18); border-radius: 13px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -10px 18px rgba(7, 26, 46, .18), 0 8px 18px rgba(4, 14, 26, .35);
  transition: border-color .2s, box-shadow .2s, background .25s, transform .25s;
}
.otp-box:nth-child(4) { margin-left: 12px; }            /* 123 456, the way the apps show it */
.otp-d { font: 700 calc(var(--w) * .5)/1 var(--display, 'Archivo', 'Arial Black', sans-serif); color: #fff; letter-spacing: 0; text-shadow: 0 1px 8px rgba(185, 239, 230, .35); }
.otp-box.on { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08)); border-color: rgba(255, 255, 255, .30); }
.otp-box.pop .otp-d { animation: otp-pop .22s cubic-bezier(.3, 1.6, .5, 1); }
.otp-box.act { border-color: rgba(185, 239, 230, .9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 3px rgba(185, 239, 230, .18), 0 0 22px rgba(185, 239, 230, .38), 0 8px 18px rgba(4, 14, 26, .35); }
.otp-box.act::after { content: ""; position: absolute; left: 50%; top: 26%; bottom: 26%; width: 2px; margin-left: -1px; border-radius: 2px; background: #b9efe6; box-shadow: 0 0 8px #b9efe6; animation: otp-caret 1s steps(1) infinite; }

.otp-in {
  position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; outline: 0;
  background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent;
  font-size: 16px; letter-spacing: 1.4em; text-indent: -999px; cursor: text; box-shadow: none; appearance: none;
}
.otp-in::selection { background: transparent; }
.otp-in:-webkit-autofill { transition: background-color 99999s; -webkit-text-fill-color: transparent; }

/* the countdown to the next code */
.otp-timer { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: rgba(232, 240, 248, .78); font-variant-numeric: tabular-nums; }
.otp-ring { --p: 1; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: conic-gradient(#b9efe6 calc(var(--p) * 360deg), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); }

/* checking: a light runs over the boxes and they lift in a wave */
.otp[data-state="checking"] .otp-box { animation: otp-wave .9s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); }
.otp[data-state="checking"] .otp-box::before { content: ""; position: absolute; inset: -20% auto -20% -60%; width: 45%; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: otp-sheen 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); }

/* ok: green, linked up, then one green tile with a tick */
.otp-link { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; margin-top: -1px; z-index: 0; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #7ff0b4, transparent); box-shadow: 0 0 10px #34c47c; transform: scaleX(0); opacity: 0; }
.otp-row { position: relative; z-index: 1; }
.otp[data-state="ok"] .otp-box { border-color: rgba(127, 240, 180, .85); background: linear-gradient(180deg, rgba(52, 196, 124, .55), rgba(29, 122, 79, .45));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 18px rgba(52, 196, 124, .45); animation: otp-gather .42s cubic-bezier(.6, 0, .4, 1) .36s forwards; }
.otp[data-state="ok"] .otp-link { animation: otp-link .62s ease-out forwards; }
.otp-tile { position: absolute; left: 50%; top: 50%; z-index: 2; width: calc(var(--w) * 1.35); height: calc(var(--w) * 1.35); margin: calc(var(--w) * -.675) 0 0 calc(var(--w) * -.675);
  border-radius: 18px; display: grid; place-items: center; opacity: 0; transform: scale(.4); pointer-events: none;
  background: linear-gradient(160deg, #5ee39a, #22a861 55%, #1d7a4f); border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -12px 20px rgba(9, 60, 36, .35), 0 0 0 6px rgba(52, 196, 124, .16), 0 0 34px rgba(52, 196, 124, .6); }
.otp-tile svg { width: 56%; height: 56%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.otp[data-state="ok"] .otp-tile { animation: otp-tile .5s cubic-bezier(.3, 1.5, .5, 1) .7s forwards; }
.otp[data-state="ok"] .otp-tile svg { animation: otp-tick .36s ease-out 1s forwards; }
.otp[data-state="ok"] .otp-timer { opacity: 0; transition: opacity .3s; }

/* bad: a shake, red, then empty for the next try (otp.js) */
.otp[data-state="bad"] .otp-row { animation: otp-shake .42s ease-in-out; }
.otp[data-state="bad"] .otp-box { border-color: rgba(255, 122, 114, .9); background: linear-gradient(180deg, rgba(255, 122, 114, .28), rgba(198, 47, 40, .18)); box-shadow: 0 0 16px rgba(255, 122, 114, .35); }

/* the submit button (the form's own .btn) */
.btn.otp-ok, .btn.otp-ok:hover, .btn.otp-ok:disabled { background: linear-gradient(180deg, #3fcf86, #22a861) !important; color: #fff !important; border-color: transparent !important; opacity: 1 !important; box-shadow: 0 6px 18px rgba(34, 168, 97, .35); }

@keyframes otp-pop { 0% { transform: scale(.55); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes otp-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes otp-wave { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
@keyframes otp-sheen { 0% { left: -60%; } 100% { left: 130%; } }
@keyframes otp-link { 0% { transform: scaleX(0); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(.2); opacity: 0; } }
@keyframes otp-gather { 0% { transform: translateX(0) scale(1); opacity: 1; } 100% { transform: translateX(var(--dx, 0)) scale(.55); opacity: 0; } }
@keyframes otp-tile { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes otp-tick { to { stroke-dashoffset: 0; } }
@keyframes otp-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

/* ── the sign-in's two-step screen: a navy scene, a glass card ── */
.auth.auth-otp .auth-form { background:
    radial-gradient(40% 34% at 16% 20%, rgba(42, 157, 143, .55), transparent 72%),
    radial-gradient(42% 36% at 86% 82%, rgba(31, 111, 208, .6), transparent 72%),
    radial-gradient(28% 24% at 78% 14%, rgba(185, 239, 230, .26), transparent 72%),
    linear-gradient(160deg, #0b2a4a 0%, #071a2e 100%); }
.auth.auth-otp .auth-card {
  max-width: 440px; min-width: 0; border-radius: 26px; color: #e8f0f8; padding: 30px 26px 24px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), inset 0 0 0 1px rgba(255, 255, 255, .04), 0 30px 70px rgba(2, 10, 20, .55);
}
.auth.auth-otp .auth-logo { display: none; }
@media (max-width: 480px) { .auth.auth-otp .auth-card { padding: 26px 18px 20px; border-radius: 22px; } }
.auth.auth-otp h1 { color: #fff; }
.auth.auth-otp .sub { color: rgba(185, 239, 230, .9); }
.auth.auth-otp .otp { margin-bottom: 18px; }
.auth.auth-otp .msg.err { color: #ffb0aa; }
.auth.auth-otp .alt .linkbtn { color: #b9efe6; }
.auth.auth-otp .btn:not(.otp-ok) { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07)); color: rgba(255, 255, 255, .75); border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.auth.auth-otp .btn.otp-ready:not(.otp-ok) { background: linear-gradient(180deg, #ffffff, #dff7f2); color: #0b2a4a; border-color: transparent; box-shadow: 0 8px 22px rgba(185, 239, 230, .28); }
.otp-badge { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 24px rgba(2, 10, 20, .4), 0 0 26px rgba(185, 239, 230, .22); }
.otp-badge svg { width: 28px; height: 28px; fill: none; stroke: #b9efe6; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  .otp-box, .otp-box .otp-d, .otp-box::before, .otp-box::after, .otp-row, .otp-link, .otp-tile, .otp-tile svg { animation: none !important; transition: none !important; }
  .otp[data-state="ok"] .otp-box { opacity: 0; }
  .otp[data-state="ok"] .otp-tile { opacity: 1; transform: none; }
  .otp[data-state="ok"] .otp-tile svg { stroke-dashoffset: 0; }
}
