/* =====================================================================
   Restaurant & admin sign in (restaurant/login.php)
   A white frame with a warm picture on the left: floating glass cards
   (orders, a buzzer going out, pick-up rate) and Buzzy, a little buzzer
   with a face. Buzzy floats over to the form, watches the email box,
   closes its eyes for the password and spins while signing in.
   JS: public/assets/js/signin.js. Prefix sg- (app.css has no sg- names).
   ===================================================================== */

.sg-body { background: #ECECF1; }
.sg-page { min-height: 100vh; min-height: 100dvh; display: grid; padding: 20px; }
.sg-frame {
  position: relative; width: min(1240px, 100%); margin: auto; min-height: min(780px, calc(100dvh - 40px));
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 10px; padding: 10px;
  background: #FCFCFD; border-radius: 30px; border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 40px 90px -40px rgba(60, 40, 80, .35);
}

/* ------------------------------------------------------------ the picture */
.sg-art {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; padding: 30px 34px 36px;
  display: flex; flex-direction: column; color: #1B1520;
  background: linear-gradient(180deg, #FCE6D8 0%, #F9D3BC 38%, #F5AE84 72%, #F29A68 100%);
}
/* a slow, warm glow that drifts around behind the cards */
.sg-art::before, .sg-art::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(46px); pointer-events: none;
}
.sg-art::before { width: 70%; aspect-ratio: 1; left: 18%; top: 48%; background: radial-gradient(circle, #EE6A2E 0%, rgba(238, 106, 46, .55) 40%, transparent 70%); animation: sg-drift 14s ease-in-out infinite alternate; }
.sg-art::after { width: 55%; aspect-ratio: 1; right: -18%; top: -14%; background: radial-gradient(circle, rgba(255, 255, 255, .85) 0%, transparent 70%); }
@keyframes sg-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14%, -8%) scale(1.12); }
  100% { transform: translate(10%, 6%) scale(.95); }
}
.sg-art .brand { color: #1B1520; }
.sg-art .brand-text span { color: #E8461E; }

.sg-stage { position: relative; width: min(430px, 100%); height: 300px; margin: 44px auto 0; }
.sg-card {
  position: absolute; border-radius: 18px; padding: 14px 16px;
  background: rgba(255, 255, 255, .74); border: 1px solid rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 1px rgba(120, 60, 30, .05), 0 22px 44px -22px rgba(150, 70, 30, .45);
  animation: sg-bob 6s ease-in-out infinite;
}
@keyframes sg-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

.sg-sales { left: 6%; top: 46px; width: 300px; padding-bottom: 8px; }
.sg-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #5C5363; }
.sg-tile { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #1B1520; color: #fff; }
.sg-tile .ic { width: 13px; height: 13px; }
.sg-k { font-weight: 650; color: #3A3340; }
.sg-live { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .8); color: #5C5363; }
.sg-live i { width: 6px; height: 6px; border-radius: 50%; background: #12B76A; box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); animation: sg-ping 1.8s ease-out infinite; }
@keyframes sg-ping { 0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, .55); } 100% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); } }
.sg-big { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.sg-big b { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #1B1520; }
.sg-big b.is-tick { animation: sg-tick .5s var(--ease); }
@keyframes sg-tick { 0% { transform: translateY(6px); opacity: .2; } 100% { transform: none; opacity: 1; } }
.sg-up { font-size: 11.5px; font-weight: 700; color: #067647; background: #DCF7E7; padding: 2px 7px; border-radius: 999px; }
.sg-chart { display: block; width: 100%; height: 64px; margin-top: 4px; overflow: visible; }
.sg-chart-fill { fill: url(#sgFill); }
.sg-chart-line { fill: none; stroke: #F06A2A; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; animation: sg-draw 1.8s .3s var(--ease) both; }
@keyframes sg-draw { from { stroke-dashoffset: 100; } }
.sg-chart-dot { fill: #fff; stroke: #F06A2A; stroke-width: 2.4; transform-origin: 202px 8px; animation: sg-dot 2.4s ease-in-out infinite; }
@keyframes sg-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

.sg-toast { right: 0; top: 0; width: 250px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; animation-delay: -2s; z-index: 2; }
.sg-av { flex: none; position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750; color: #fff; background: #3A3340; transition: background-color .4s; }
.sg-av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; background: #12B76A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 8px no-repeat; }
.sg-toast-txt { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.sg-toast-txt strong { font-size: 13px; color: #1B1520; }
.sg-toast-txt small { font-size: 11.5px; color: #7A7180; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-toast-n { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: #1B1520; font-variant-numeric: tabular-nums; }
.sg-toast.is-swap .sg-toast-txt, .sg-toast.is-swap .sg-toast-n, .sg-toast.is-swap .sg-av { animation: sg-swap .55s var(--ease); }
@keyframes sg-swap { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: none; } }

.sg-ring { left: 0; top: 196px; display: flex; align-items: center; gap: 10px; padding: 11px 14px; animation-delay: -4s; z-index: 2; }
.sg-ring svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.sg-ring circle { fill: none; stroke-width: 4.5; }
.sg-ring-bg { stroke: rgba(18, 183, 106, .16); }
.sg-ring-fg { stroke: #12B76A; stroke-linecap: round; stroke-dasharray: 98.6 100; animation: sg-ring 1.6s .5s var(--ease) both; }
@keyframes sg-ring { from { stroke-dasharray: 0 100; } }
.sg-ring b { display: block; font-size: 15px; font-weight: 800; color: #1B1520; }
.sg-ring small { display: block; font-size: 11px; color: #7A7180; }

.sg-pill { position: absolute; right: 6%; top: 236px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #1B1520; background: rgba(255, 255, 255, .8); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 16px 30px -18px rgba(150, 70, 30, .55); animation: sg-bob 6s -1s ease-in-out infinite; }
.sg-pill-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #FF7A2F, #FF2E63); }
.sg-pill-dot .ic { width: 13px; height: 13px; animation: sg-ring-bell 2.6s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes sg-ring-bell { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(16deg); } 80% { transform: rotate(-14deg); } 86% { transform: rotate(9deg); } 92% { transform: rotate(-5deg); } }

.sg-orb-home { width: 84px; height: 84px; margin: 6px auto 0; }
.sg-art-copy { margin-top: auto; }
.sg-kicker { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: rgba(27, 21, 32, .62); }
.sg-art h1 { margin: 0; font-size: clamp(30px, 3.3vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; color: #1B1520; max-width: 460px; }

/* ------------------------------------------------------------ the form */
.sg-side { position: relative; display: grid; place-items: center; padding: 70px 28px 28px; }
.sg-lang { position: absolute; top: 18px; right: 18px; z-index: 3; }
.sg-box { width: min(390px, 100%); }
.sg-box > .sg-orb-home.is-form { margin: 0 auto 6px; }
.sg-mark { width: 26px; height: 26px; fill: none; stroke: #F06A2A; stroke-width: 2.4; stroke-linecap: round; display: block; margin-bottom: 14px; animation: sg-twirl 8s linear infinite; }
@keyframes sg-twirl { to { transform: rotate(360deg); } }
.sg-box h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: #12101A; }
.sg-sub { margin: 8px 0 0; color: #7A7486; font-size: 14.5px; line-height: 1.5; max-width: 340px; }
.sg-alert { margin: 18px 0 0; }

.sg-form { display: grid; gap: 16px; margin-top: 24px; }
.sg-form .field > span, .sg-label-row label { font-size: 13px; font-weight: 650; color: #2B2733; }
.sg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sg-label-row .auth-forgot { margin: 0; font-size: 12.5px; font-weight: 600; color: #8A8494; text-decoration: none; }
.sg-label-row .auth-forgot:hover { color: #E8461E; text-decoration: underline; }
.sg-form .field input {
  min-height: 50px; border-radius: 12px; background: #F6F6F9; border: 1px solid #E7E6EE; box-shadow: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.sg-form .field input:hover { background: #F2F2F6; }
.sg-form .field input:focus { background: #fff; border-color: #F39A6A; box-shadow: 0 0 0 4px rgba(240, 106, 42, .14); }
.sg-form .field input::placeholder { color: #B3AEBC; }

.sg-submit {
  position: relative; margin-top: 6px; min-height: 52px; width: 100%; border: 0; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-size: 15.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #2A2631 0%, #121016 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 14px 26px -12px rgba(18, 16, 22, .55);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.sg-submit:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 18px 32px -12px rgba(18, 16, 22, .6); }
.sg-submit:active { transform: translateY(1px); }
.sg-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(240, 106, 42, .35); }
.sg-submit .ic { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.sg-submit:hover .ic { transform: translateX(3px); }
.sg-spin { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: sg-spin .7s linear infinite; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.sg-busy { display: none; }
.sg-submit.is-busy { cursor: progress; transform: none; }
.sg-submit.is-busy .sg-spin, .sg-submit.is-busy .sg-busy { display: inline-block; }
.sg-submit.is-busy .sg-go, .sg-submit.is-busy .ic { display: none; }

.sg-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; font-size: 12.5px; color: #9A94A4; }
.sg-or::before, .sg-or::after { content: ""; flex: 1; height: 1px; background: #ECEBF1; }
.sg-alt {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px;
  border: 1px solid #E7E6EE; background: #fff; color: #2B2733; font-weight: 650; font-size: 14px; text-decoration: none;
  transition: border-color .2s, background-color .2s, transform .15s var(--ease);
}
.sg-alt:hover { background: #FFF6F1; border-color: #F6C4A8; transform: translateY(-1px); }
.sg-alt .ic { width: 17px; height: 17px; color: #F06A2A; }
.sg-foot { margin: 16px 0 0; text-align: center; font-size: 13.5px; color: #8A8494; }
.sg-foot a { color: #E8461E; font-weight: 650; text-decoration: none; }
.sg-foot a:hover { text-decoration: underline; }
.sg-legal { margin-top: 22px; }

/* error: the form gives a little shake */
.sg-frame[data-mood="error"] .sg-form { animation: sg-shake .5s .15s ease-in-out; }
@keyframes sg-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ------------------------------------------------------------ Buzzy */
/* Placed over its "home" by signin.js; without JavaScript it simply is not shown. */
.sg-orb { position: absolute; left: 0; top: 0; width: 84px; height: 84px; z-index: 5; pointer-events: none; visibility: hidden; transform: translate(var(--ox, 0), var(--oy, 0)); }
.sg-frame.sg-ready .sg-orb { visibility: visible; }
.sg-frame.sg-move .sg-orb { transition: transform 1s cubic-bezier(.55, 0, .2, 1); }
.sg-orb-body { position: absolute; inset: 0; animation: sg-float 4.2s ease-in-out infinite; }
@keyframes sg-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.sg-orb.is-flying .sg-orb-body { animation: sg-hop 1s cubic-bezier(.55, 0, .2, 1); }
@keyframes sg-hop { 0% { transform: scale(1); } 35% { transform: translateY(-34px) scale(1.12) rotate(-10deg); } 75% { transform: translateY(-6px) scale(.96) rotate(6deg); } 100% { transform: scale(1); } }
.sg-ball {
  position: absolute; inset: 6px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 34% 28%, #FFE9D6 0%, #FFB27A 20%, #FF7A2F 48%, #FF4A4E 76%, #E8265A 100%);
  box-shadow: inset -6px -8px 16px rgba(160, 20, 60, .4), inset 6px 6px 14px rgba(255, 255, 255, .4), 0 0 0 3px rgba(255, 255, 255, .85), 0 18px 30px -10px rgba(232, 60, 60, .6);
}
.sg-ball::after { content: ""; position: absolute; left: 20%; top: 12%; width: 30%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, .55); filter: blur(3px); transform: rotate(-24deg); }
.sg-face { position: absolute; left: 50%; top: 50%; width: 40px; height: 30px; margin: -14px 0 0 -20px; transform: translate(var(--fx, 0px), var(--fy, 0px)); transition: transform .25s var(--ease); }
.sg-eye { position: absolute; top: 2px; left: 7px; width: 7px; height: 11px; border-radius: 4px; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .7); transform-origin: 50% 70%; animation: sg-blink 5s infinite; transition: height .2s, top .2s, border-radius .2s; }
.sg-eye.is-r { left: auto; right: 7px; }
@keyframes sg-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.sg-mouth { position: absolute; left: 50%; top: 17px; width: 18px; height: 9px; margin-left: -9px; overflow: visible; }
.sg-mouth path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; opacity: 0; transition: opacity .2s; }
.sg-mouth .m-smile { opacity: 1; }
.sg-cheek { position: absolute; top: 56%; left: 16%; width: 10px; height: 6px; border-radius: 50%; background: rgba(255, 214, 160, .7); filter: blur(1.5px); }
.sg-cheek.is-r { left: auto; right: 16%; }
.sg-wave { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid rgba(255, 90, 60, .5); opacity: 0; animation: sg-buzz 3.6s ease-out infinite; }
.sg-wave.is-2 { animation-delay: .5s; }
@keyframes sg-buzz { 0%, 55% { transform: scale(1); opacity: 0; } 60% { opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

.sg-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translate(-50%, 6px) scale(.9); transform-origin: 50% 100%;
  white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #FF7A2F, #FF2E63); box-shadow: 0 10px 20px -10px rgba(232, 50, 70, .8);
  opacity: 0; transition: opacity .25s, transform .3s var(--ease);
}
.sg-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #FF4B4B; }
.sg-bubble.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* moods */
.sg-orb[data-face="shy"] .sg-eye { height: 3px; top: 7px; border-radius: 2px; animation: none; }
.sg-orb[data-face="shy"] .sg-mouth .m-smile { opacity: 0; }
.sg-orb[data-face="shy"] .sg-mouth .m-o { opacity: 1; }
.sg-orb[data-face="peek"] .sg-eye { height: 3px; top: 7px; border-radius: 2px; animation: none; }
.sg-orb[data-face="peek"] .sg-eye.is-r { height: 11px; top: 2px; border-radius: 4px; }
.sg-orb[data-face="sad"] .sg-mouth .m-smile { opacity: 0; }
.sg-orb[data-face="sad"] .sg-mouth .m-frown { opacity: 1; }
.sg-orb[data-face="sad"] .sg-eye { height: 8px; top: 4px; }
.sg-orb[data-face="sad"] .sg-orb-body { animation: sg-no .6s ease-in-out 2, sg-float 4.2s 1.2s ease-in-out infinite; }
@keyframes sg-no { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.sg-orb[data-face="happy"] .sg-eye { height: 6px; top: 4px; border-radius: 6px 6px 2px 2px; }
.sg-orb[data-face="busy"] .sg-eye { height: 9px; top: 0; }
.sg-orb[data-face="busy"] .sg-ball { animation: sg-wobble .9s ease-in-out infinite; }
@keyframes sg-wobble { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.04); } }

/* ------------------------------------------------------------ phones and small windows */
@media (max-width: 900px) {
  .sg-body { background: #FCFCFD; }
  .sg-page { padding: 0; }
  .sg-frame { display: block; min-height: 100dvh; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #FCFCFD; }
  .sg-art { border-radius: 0; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 44px; }
  .sg-art-top { display: flex; }
  .sg-stage { height: 156px; width: min(360px, 100%); margin-top: 10px; }
  .sg-sales { left: 0; top: 44px; width: 222px; padding: 9px 12px 2px; }
  .sg-live { display: none; }
  .sg-big { margin-top: 4px; }
  .sg-big b { font-size: 24px; }
  .sg-chart { height: 30px; }
  .sg-toast { width: 214px; top: 0; padding: 8px 10px; }
  .sg-av { width: 28px; height: 28px; font-size: 10.5px; }
  .sg-ring { left: auto; right: 0; top: 100px; padding: 8px 10px; gap: 8px; }
  .sg-ring svg { width: 32px; height: 32px; }
  .sg-pill, .sg-art .sg-orb-home, .sg-art-copy { display: none; }
  .sg-side { display: block; position: relative; margin-top: -30px; padding: 0 20px calc(30px + env(safe-area-inset-bottom, 0px)); background: #FCFCFD; border-radius: 28px 28px 0 0; }
  .sg-lang { top: 14px; right: 14px; }
  .sg-box { margin: 0 auto; padding-top: 4px; }
  .sg-box > .sg-orb-home.is-form { width: 76px; height: 76px; margin: -38px 0 4px; }
  .sg-orb { width: 76px; height: 76px; }
  .sg-mark { display: none; }
  .sg-box h2 { font-size: 28px; }
  .sg-sub { font-size: 14px; }
  .sg-form { margin-top: 18px; gap: 14px; }
  .sg-form .field input { font-size: 16px; } /* iPhone zooms into smaller boxes */
}
@media (max-width: 380px) {
  .sg-toast { width: 196px; }
  .sg-sales { width: 196px; }
}
/* a short laptop screen: keep the sign in box on the first screen */
@media (min-width: 901px) and (max-height: 760px) {
  .sg-stage { height: 270px; margin-top: 26px; transform: scale(.92); transform-origin: 50% 0; }
  .sg-side { padding-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-art::before, .sg-card, .sg-pill, .sg-live i, .sg-chart-line, .sg-chart-dot, .sg-ring-fg, .sg-pill-dot .ic, .sg-mark,
  .sg-orb-body, .sg-wave, .sg-eye, .sg-frame[data-mood="error"] .sg-form, .sg-orb[data-face] .sg-orb-body, .sg-orb[data-face="busy"] .sg-ball { animation: none !important; }
  .sg-frame.sg-move .sg-orb { transition: none; }
}
