/* ============================================================
   login-redesign.css — visual redesign for the login page only.
   Page-scoped (loaded via login.blade.php's @section('pagecss')).

   Design read: the page is drawn as a printed circuit board seen
   from above — pale solder mask, fine routed traces entering from
   all four edges, plated vias where they change layer. Foxlink
   makes connectors and cable assemblies, so the board is the
   company's own vernacular rather than a stock login illustration;
   PHRKS deliberately runs a plain brand-gradient panel, so the two
   sites read as different products without either looking wrong.

   The board is light on purpose. A dark login page followed by the
   app's light interior produced a brightness jump on every sign-in,
   and the trace colour is a desaturated brand blue so the whole
   page sits in one hue — an earlier copper-gold version fought
   --brand, which is its opposite colour temperature.

   Everything is CSS plus one inline SVG in the blade — no image
   asset. login-bg.jpg (938 KB of unrelated AI cityscape with
   English text baked into it) is now referenced by no view at all:
   this page dropped it, and food-order-redesign.css did the same
   for the three meal-order pages. The file is still in
   public/assets/img/ and can be deleted.

   --brand / --ink / --line / --ground come from custom.css's
   :root — shared with the other page-scoped redesign files, not
   redefined here. --lg-* below are login-only.
   ============================================================ */

:root{
  /* board + routing, login page only */
  --lg-board:      #e8edf1;
  --lg-trace:      #7ba3c4;
  --lg-trace-thin: #a9bccd;
  --lg-panel-line: #c3d1db;
  /* matches custom.css's .form-control border so the captcha box,
     which is not a .form-control, still lines up with the inputs */
  --lg-field-line: #dde1e6;
  --lg-vietnam:    #006db6;
  /* the project ships no webfonts; this is the system mono stack */
  --lg-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, Menlo, monospace;
}

/* ------------------------------------------------------------
   Be Vietnam Pro — drawn for Vietnamese. Stacked tone marks
   (ế ộ ữ ằ) clip or collide in faces that treat Vietnamese as an
   afterthought, and this site's primary audience reads Vietnamese.

   The @font-face block is commented out because the woff2 files
   are not in the repo yet — live, it would 404 three times on
   every login. To enable: download Be Vietnam Pro (SIL Open Font
   License) and drop these three files into public/assets/fonts/,
   then uncomment. The family name already leads every stack
   below, so the page picks the face up with no other change; until
   then it falls through to the system CJK faces and the layout is
   identical either way.

@font-face{
  font-family:"Be Vietnam Pro";
  src:url("../fonts/BeVietnamPro-Regular.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Be Vietnam Pro";
  src:url("../fonts/BeVietnamPro-SemiBold.woff2") format("woff2");
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Be Vietnam Pro";
  src:url("../fonts/BeVietnamPro-Bold.woff2") format("woff2");
  font-weight:700; font-style:normal; font-display:swap;
}
   ------------------------------------------------------------ */

/* ---------- board ---------- */
.lg-board{
  position:relative;
  min-height:100vh;
  background:var(--lg-board);
  overflow:hidden;
  font-family:"Be Vietnam Pro","PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif;
  color:var(--ink);
}

/* routed traces — decorative, sized to cover and crop from the centre */
.lg-traces{
  position:absolute; inset:0;
  width:100%; height:100%;
  pointer-events:none;
}
.lg-trace-main{ stroke:var(--lg-trace); stroke-width:1.5; fill:none; opacity:.55; stroke-linejoin:round; }
.lg-trace-thin{ stroke:var(--lg-trace-thin); stroke-width:1; fill:none; opacity:.7; }
.lg-via circle{ fill:none; stroke:var(--lg-trace); stroke-width:1.6; }
.lg-via .lg-via-hole{ fill:var(--lg-board); stroke:none; }

/* the traces run edge to edge; this fades them out under the panel
   so the form never competes with the artwork behind it */
.lg-veil{
  position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(58% 54% at 50% 50%,
    rgba(232,237,241,.95) 34%,
    rgba(232,237,241,.55) 70%,
    rgba(232,237,241,0) 100%);
}

/* ---------- language selector ----------
   x-lang-dropdown is shared with the rest of the app and ships a
   solid .btn-primary plus float-end; both are neutralised here so
   it reads as a quiet outlined control on the board. */
.lg-lang{ position:absolute; top:24px; right:44px; z-index:3; }
.lg-lang .dropdown-toggle.btn{
  float:none;
  background:var(--surface); border:1px solid #b6c8d6; color:#4a6c86;
  font-size:13px; font-weight:500; border-radius:8px; padding:7px 13px;
  box-shadow:none;
}
.lg-lang .dropdown-toggle.btn:hover,
.lg-lang .dropdown-toggle.btn:focus{
  background:var(--surface); border-color:var(--brand); color:var(--brand);
}

/* ---------- panel ---------- */
.lg-center{
  position:relative; z-index:2;
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:88px 20px 48px;
}
.lg-panel{
  width:100%; max-width:456px;
  background:var(--surface);
  border:1px solid var(--lg-panel-line);
  border-radius:4px;
  padding:34px 38px;
  box-shadow:0 10px 30px rgba(20,45,70,.09);
}
.lg-logo{ display:block; text-align:center; margin-bottom:16px; }
.lg-logo img{ max-height:52px; }
/* plant wordmark — hairlines fade out from the type on both sides.
   --lg-vietnam is the Foxlink corporate blue and is deliberately not
   --brand (#0e5c93, inherited from the purchased template's button
   colour); keeping them separate means neither drifts into the other. */
.lg-wordmark{
  display:flex; align-items:center; justify-content:center;
  margin:0 0 20px;
}
.lg-wordmark-rule{
  flex:1 1 0; max-width:50px; height:1px;
}
.lg-wordmark-rule:first-child{
  background:linear-gradient(to left, var(--lg-vietnam), transparent);
}
.lg-wordmark-rule:last-child{
  background:linear-gradient(to right, var(--lg-vietnam), transparent);
}
.lg-wordmark-text{
  margin:0 15px;
  font-size:.9rem; font-weight:700; letter-spacing:3px;
  color:var(--lg-vietnam);
}
.lg-rule{ height:2px; background:var(--brand); margin-bottom:22px; }

/* ---------- the two systems this page fronts ---------- */
.lg-tabs{
  display:flex; margin-bottom:24px;
  border:1px solid var(--lg-panel-line); border-radius:8px; overflow:hidden;
}
.lg-tabs a{
  flex:1; text-align:center; padding:9px 6px;
  font-size:13.5px; font-weight:500; color:var(--ink-soft);
  text-decoration:none; background:var(--surface);
  transition:background .12s ease, color .12s ease;
}
.lg-tabs a + a{ border-left:1px solid var(--lg-panel-line); }
.lg-tabs a:hover{ background:#f2f6f9; color:var(--brand); }
.lg-tabs a.active{ background:var(--brand); color:#fff; font-weight:700; }
.lg-tabs a.active:hover{ background:var(--brand); color:#fff; }

/* ---------- fields ---------- */
.lg-field{ margin-bottom:16px; }
.lg-field label{
  display:block;
  font-family:var(--lg-mono);
  font-size:9.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:7px;
}
/* height, radius, border and focus ring all come from custom.css's
   own .form-control — these pages deliberately do not restyle the
   controls, only the surface they sit on, so a field here and a field
   inside the app are the same object. */
.lg-field .form-control::placeholder{ color:var(--ink-faint); }

/* verify code: one control, not an input with a loose image beside it.
   The captcha is 130x36 (config/captcha.php) and object-fit:contain
   letterboxes it inside this box, so the digits are never cropped.
   152px on desktop, 128px below 576px — sized so the Vietnamese
   placeholder in the input beside it still fits at both widths. */
.lg-captcha-row{ display:flex; gap:9px; align-items:stretch; }
.lg-captcha-row .form-control{ flex:1; min-width:0; }
.lg-captcha-img{
  flex:0 0 auto; width:152px; height:44px;
  border:1px solid var(--lg-field-line); border-radius:8px;
  overflow:hidden; cursor:pointer; background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  transition:border-color .15s ease;
}
.lg-captcha-img:hover{ border-color:var(--brand); }
.lg-captcha-img img{ width:100%; height:100%; object-fit:contain; display:block; }
/* change_psn() appends its "reloading.." div to the closest div */
.lg-captcha-img .psnloaddiv{ display:none; }

/* ---------- actions ---------- */
.lg-submit{ margin-top:24px; }
/* .btn.btn-primary and .btn.btn-outline-primary carry the colour,
   height, radius and type; only the full-width stretch and the SSO
   button's icon row are page layout. */
.lg-btn-primary{ width:100%; }

.lg-links{
  display:flex; justify-content:space-between; gap:16px; margin-top:14px;
  font-family:var(--lg-mono);
  font-size:10.5px; letter-spacing:.04em;
}
.lg-links a{ color:var(--ink-soft); text-decoration:none; }
.lg-links a:hover{ color:var(--brand); text-decoration:underline; }

.lg-divider{
  display:flex; align-items:center; gap:12px; margin:18px 0 14px;
  font-family:var(--lg-mono);
  font-size:10px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ink-faint);
}
.lg-divider::before,.lg-divider::after{ content:""; flex:1; height:1px; background:var(--line); }

/* ---------- Foxlink SSO ----------
   1:1 rebuild of the corporate spec at
   https://ssot.foxlink.com.tw/sso-button — outline variant (the solid
   blue one is only for systems where SSO is the one way in, and this
   page also takes a password). The spec allows three heights and no
   others: 40 compact / 48 standard / 56 mobile, each with its own type
   size and mark size. This page uses 40 and steps up to 48 on phones,
   where a 40px tap target is on the small side. That spec fixes the
   colour, size, weight and spacing, so unlike every other control on
   this page these values are literal and are NOT taken from
   custom.css or from --brand; #0078C0 is the SSO mark's blue, not the
   product's. Do not fold them together.

   One deliberate deviation: the spec asks for this button above the
   other login methods. Here SSO is the other login method — employee
   number and password is the normal way in — so it sits under the
   divider that says so. Nothing about the button itself deviates. */
.foxlink-sso-btn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%;                 /* spec: inside a form, full width, contents centred */
  height:40px; padding:0 22px;              /* compact tier */
  border:1px solid #D2D9DF; border-left:3px solid #0078C0; border-radius:4px;
  background:#FFFFFF; color:#16202B; font-size:14px; text-decoration:none;
  transition:background 140ms ease, border-color 140ms ease;
}
.foxlink-sso-btn img{ width:20px; height:20px; }
.foxlink-sso-btn .brand{ font-weight:700; color:#16202B; }
.foxlink-sso-btn .action{ font-weight:500; color:#4C5A67; }
.foxlink-sso-btn img{ flex:0 0 auto; }
/* the border-color shorthand would take the left marker bar with it,
   so every state restates border-left-color — the spec calls this out
   as the usual way to get this button wrong. */
.foxlink-sso-btn:hover{
  background:#F7FAFC; border-color:#0078C0; border-left-color:#0078C0; color:#16202B;
}
.foxlink-sso-btn:active{
  background:#EDF3F8; border-color:#005285; border-left-color:#005285;
}
.foxlink-sso-btn:focus-visible{
  outline:3px solid rgba(0,120,192,.3); outline-offset:2px;
}

/* loading: shield swaps for an 18px spinner, action word becomes
   "signing in", and the link stops accepting clicks so the authorize
   redirect cannot be fired twice. */
.foxlink-sso-btn.is-loading{
  background:#FFFFFF; border-color:#D2D9DF; border-left-color:#0078C0;
  pointer-events:none;
}
.foxlink-sso-btn.is-loading .action{ color:#6B7885; }
.foxlink-sso-spinner{
  flex:0 0 auto; width:18px; height:18px; border-radius:50%;
  border:2px solid #DCE3E8; border-top-color:#0078C0;
  animation:foxlink-sso-spin .7s linear infinite;
}
@keyframes foxlink-sso-spin{ to{ transform:rotate(360deg); } }

.foxlink-sso-note{
  margin:8px 0 0; text-align:center;
  font-size:12px; color:#7A8794;
}

/* ---------- narrow screens ----------
   Below the panel's own width the traces crop to noise, so the
   panel takes the space instead of the artwork being scaled down. */
@media (max-width:575.98px){
  /* SSO spec size tier: step up to the 48px standard on phones —
     15px type, 22px mark — so the tap target stays comfortable. */
  .foxlink-sso-btn{ height:48px; font-size:15px; }
  .foxlink-sso-btn img{ width:22px; height:22px; }

  .lg-lang{ top:16px; right:16px; }
  .lg-center{ padding:72px 14px 32px; }
  .lg-panel{ padding:26px 22px; }
  .lg-captcha-img{ width:128px; }
}
@media (max-width:359.98px){
  .lg-captcha-row{ flex-wrap:wrap; }
  .lg-captcha-row .form-control{ flex:1 0 100%; }
  .lg-captcha-img{ width:100%; }
}

@media (prefers-reduced-motion:reduce){
  .lg-tabs a,.lg-captcha-img,.foxlink-sso-btn{ transition:none; }
  .foxlink-sso-spinner{ animation:none; }
}
