/* =====================================================================
   Washnah Tender Management — "Oasis" sign-in and standalone pages
   Same layout and values as ESCC's sign-in (public/css/app.css §17):
   an oasis brand panel with the contour texture and a light form panel.
   Self-contained: these pages do not load the application bundle.
   ===================================================================== */
:root {
  --o-font: "IBM Plex Sans Arabic", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
  --o-bg: #f1f4f2;
  --o-surface: #ffffff;
  --o-surface-2: #f6f8f7;
  --o-surface-3: #eaf2ef;
  --o-line: #dce4e1;
  --o-line-strong: #c6d3cf;
  --o-text: #13221f;
  --o-muted: #5b6c68;
  --o-faint: #677873;
  --o-brand: #00594f;
  --o-brand-strong: #004741;
  --o-brand-soft: #e3f0ec;
  --o-primary: #00594f;
  --o-primary-hover: #004741;
  --o-oasis: #0d3833;
  --o-oasis-2: #072723;
  --o-on-oasis-muted: rgba(226, 241, 237, .72);
  --o-success: #0e7a57;
  --o-success-soft: #e1f2ea;
  --o-warning: #93600e;
  --o-warning-soft: #fbefd8;
  --o-danger: #b42a23;
  --o-danger-soft: #fbe7e5;
  --o-focus: #1d8f7f;
  --o-r-xs: 6px;
  --o-r-sm: 9px;
  --o-r-md: 12px;
  --o-r-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.wsa { margin: 0; min-height: 100vh; font-family: var(--o-font); font-size: 15px; line-height: 1.65; color: var(--o-text); background: var(--o-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[dir="rtl"] body.wsa { text-align: right; }
.wsa a { color: var(--o-brand); text-decoration: none; }
.wsa :focus-visible { outline: 2px solid var(--o-focus); outline-offset: 2px; border-radius: 6px; }
.wsa .ui-icon { width: 1.2em; height: 1.2em; display: block; flex: 0 0 auto; overflow: visible; }
.wsa h1, .wsa h2 { line-height: 1.3; margin: 0; font-weight: 800; }
.wsa p { margin: 0; }

/* Layout */
.wsa-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }

/* Brand panel — oasis with the contour texture */
.wsa-brand { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 56px; background: linear-gradient(160deg, var(--o-oasis) 0%, var(--o-oasis-2) 100%); color: #fff; overflow: hidden; }
.wsa-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("/brand/contours.svg") center / cover; opacity: .14; }
.wsa-brand-logo { width: min(300px, 70%); height: auto; }
.wsa-brand-copy { max-width: 560px; }
.wsa-brand-title { margin: 10px 0 14px !important; font-size: clamp(32px, 4vw, 52px); font-weight: 800; line-height: 1.2; color: #fff; }
.wsa-brand-copy p:not(.wsa-brand-title) { max-width: 46ch; color: var(--o-on-oasis-muted); font-size: 17px; line-height: 1.8; }
.wsa-brand-facts { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); color: var(--o-on-oasis-muted); font-size: 13.5px; }
.wsa-brand-facts span { display: inline-flex; align-items: center; gap: 8px; }
.wsa-brand-facts .ui-icon { width: 17px; height: 17px; color: #8fe0cf; }

.wsa-eyebrow { display: block; font-size: 12.5px; font-weight: 650; color: var(--o-brand); line-height: 1.5; }
.wsa-eyebrow.is-light { color: var(--o-on-oasis-muted); text-align: start; }
[dir="rtl"] .wsa-eyebrow.is-light { text-align: right; }

/* Form panel */
.wsa-form-panel { display: grid; place-items: center; padding: 40px 28px; }
.wsa-form-wrap { width: min(430px, 100%); }
.wsa-mobile-logo { display: none; width: 200px; margin-bottom: 28px; }
.wsa-card { padding: 4px 0; }
.wsa-card .wsa-eyebrow { margin-bottom: 4px; }
.wsa-card h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; color: var(--o-text); }
.wsa-lead { margin-bottom: 22px !important; color: var(--o-muted); font-size: 14.5px; line-height: 1.75; }
.wsa-language { position: fixed; z-index: 100; inset-block-start: 18px; inset-inline-end: 18px; margin: 0; }
.wsa-language button { min-width: 52px; height: 38px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--o-line); border-radius: var(--o-r-sm); background: var(--o-surface); color: var(--o-text); font: 800 13px/1 var(--o-font); cursor: pointer; }
.wsa-language button:hover { border-color: var(--o-line-strong); color: var(--o-brand); }

/* Fields (ESCC .field) */
.wsa-form { display: grid; gap: 16px; }
.wsa-field { display: grid; gap: 6px; min-width: 0; }
.wsa-field label { display: block; }
.wsa-field span { font-size: 13px; font-weight: 650; color: var(--o-text); }
.wsa-field small { color: var(--o-muted); font-size: 12.5px; line-height: 1.6; }
.wsa input[type="email"], .wsa input[type="password"], .wsa input[type="text"] {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--o-line-strong); border-radius: var(--o-r-sm);
  background: var(--o-surface); color: var(--o-text); font: inherit; font-size: 14.5px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wsa input::placeholder { color: var(--o-faint); }
.wsa input:hover { border-color: color-mix(in srgb, var(--o-brand) 35%, var(--o-line-strong)); }
.wsa input:focus { border-color: var(--o-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--o-focus) 22%, transparent); }
.wsa input[dir="ltr"] { direction: ltr; }
[dir="rtl"] .wsa input[type="email"], [dir="rtl"] .wsa input[type="password"], [dir="rtl"] .wsa input[type="text"] { text-align: right; }
.wsa input.wsa-otp { letter-spacing: .5em; font-variant-numeric: tabular-nums; font-size: 18px; text-align: center !important; }
.wsa-password { position: relative; }
.wsa-password input { padding-inline-start: 46px; }
[dir="rtl"] .wsa-password input { padding-left: 46px; padding-right: 12px; }
.wsa-toggle { position: absolute; top: 2px; left: 2px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: var(--o-r-xs); background: transparent; color: var(--o-muted); cursor: pointer; }
[dir="ltr"] .wsa-toggle { left: auto; right: 2px; }
[dir="ltr"] .wsa-password input { padding-left: 12px; padding-right: 46px; }
.wsa-toggle:hover { color: var(--o-text); }
.wsa-toggle .ui-icon { width: 19px; height: 19px; }
.wsa-toggle[aria-pressed="true"] { color: var(--o-brand); }
.wsa-caps { margin: 2px 0 0 !important; font-size: 13px; color: var(--o-warning); font-weight: 650; }
.wsa-caps[hidden] { display: none; }
.wsa-rules { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12.5px; color: var(--o-muted); }
.wsa-rules li { display: flex; align-items: center; gap: 7px; }
.wsa-rules li::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--o-line-strong); }
.wsa-rules li.is-ok { color: var(--o-success); }
.wsa-rules li.is-ok::before { background: var(--o-success); }

/* Buttons (ESCC .button) */
.wsa-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--o-line); border-radius: var(--o-r-sm); background: var(--o-surface); color: var(--o-text); font: 700 14px/1.3 var(--o-font); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.wsa-button.is-primary { background: var(--o-primary); border-color: var(--o-primary); color: #fff; }
.wsa-button.is-primary:hover { background: var(--o-primary-hover); border-color: var(--o-primary-hover); }
.wsa-button.is-full { width: 100%; min-height: 46px; font-size: 15px; margin-top: 4px; }
.wsa-text-link { display: inline-block; margin-top: 16px; color: var(--o-brand); font-weight: 650; font-size: 13.5px; }
.wsa-text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.wsa-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; }

/* Messages (ESCC flash) */
.wsa-alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--o-line); border-inline-start: 4px solid var(--o-brand); border-radius: var(--o-r-md); background: var(--o-surface); font-size: 14px; line-height: 1.65; }
.wsa-alert.is-error { border-inline-start-color: var(--o-danger); background: color-mix(in srgb, var(--o-danger-soft) 55%, var(--o-surface)); }
.wsa-alert.is-warning { border-inline-start-color: var(--o-warning); background: color-mix(in srgb, var(--o-warning-soft) 55%, var(--o-surface)); }
.wsa-alert.is-success { border-inline-start-color: var(--o-success); background: color-mix(in srgb, var(--o-success-soft) 55%, var(--o-surface)); }

.wsa-footnote { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 32px !important; padding-top: 16px; border-top: 1px solid var(--o-line); color: var(--o-faint); font-size: 12px; }

/* Standalone pages: maintenance and errors for signed-out visitors */
body.wsa-solo { background: linear-gradient(160deg, var(--o-oasis) 0%, var(--o-oasis-2) 100%); }
body.wsa-solo::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("/brand/contours.svg") center / cover; opacity: .14; }
.wsa-solo-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 20px; }
.wsa-solo-logo { width: 200px; height: auto; }
.wsa-solo-card { width: min(560px, 100%); padding: 36px 32px; background: var(--o-surface); border-radius: var(--o-r-lg); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.wsa .ws-error { display: grid; place-items: center; gap: 10px; text-align: center; }
.wsa .ws-error-code { margin: 0; font-size: clamp(64px, 12vw, 110px); line-height: 1; font-weight: 800; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--o-brand) 55%, transparent); font-variant-numeric: tabular-nums; }
.wsa .ws-error h1 { margin: 0; font-size: 24px; }
.wsa .ws-error-text { max-width: 56ch; color: var(--o-muted); }
.wsa .ws-error-ref { color: var(--o-muted); font-size: 13px; }
.wsa .ws-error-ref code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--o-surface-3); padding: 1px 5px; border-radius: 5px; }
.wsa .ws-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.wsa .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--o-line); border-radius: var(--o-r-sm); background: var(--o-surface); color: var(--o-text); font: 700 14px/1.3 var(--o-font); text-decoration: none; cursor: pointer; }
.wsa .btn.primary { background: var(--o-primary); border-color: var(--o-primary); color: #fff; }
.wsa .btn.primary:hover { background: var(--o-primary-hover); }
.wsa .ws-error-stack { max-width: 100%; max-height: 280px; overflow: auto; margin: 10px 0 0; padding: 14px; background: var(--o-surface-2); border: 1px solid var(--o-line); border-radius: var(--o-r-md); font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; text-align: left; direction: ltr; }

/* Phones and tablets: the brand panel steps aside, the colour logo leads the form (ESCC ≤ 940px) */
@media (max-width: 940px) {
  .wsa-shell { grid-template-columns: 1fr; }
  .wsa-brand { display: none; }
  .wsa-mobile-logo { display: block; }
}
@media (max-width: 760px) {
  .wsa-form-panel { place-items: start center; padding: 72px 18px 28px; }
  .wsa-card h1 { font-size: 24px; }
  .wsa-solo-card { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .wsa *, .wsa *::before, .wsa *::after { transition-duration: .01ms !important; }
}
