html.clofit-welcome-open{overflow:hidden}
.clofit-video-fallback{position:absolute;inset:0;display:grid;place-items:center;background:#fff;z-index:1;pointer-events:none}
.clofit-welcome video{aspect-ratio:9 / 16;transition:opacity .18s ease-out}
.clofit-welcome-media:not(.is-playing) video{opacity:0}
.clofit-welcome-media.is-playing .clofit-video-fallback{display:none}
.clofit-welcome video::-webkit-media-controls-start-playback-button{display:none!important;-webkit-appearance:none}
@media(prefers-reduced-motion:reduce){.clofit-welcome video{transition:none}}
html body .clofit-welcome-legal{display:flex;flex-wrap:wrap;justify-content:center;width:var(--welcome-content-width);flex:none;box-sizing:border-box;gap:0 12px;text-align:center;font-size:13px;padding:12px 0 14px;background:#fff;color:#666}
html body .clofit-welcome-legal a{display:flex;align-items:center;justify-content:center;min-height:44px;color:inherit;text-decoration:underline;text-underline-offset:3px;padding:0 4px}
.clofit-video-retry{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%);padding:12px 24px;border:1px solid #ccc;border-radius:24px;background:white;color:#222;font:inherit;cursor:pointer}
.clofit-video-retry[hidden]{display:none!important}
/* Scroll short screens rather than crop or stretch the original video. */
html body .clofit-welcome{position:fixed;inset:0;z-index:10000;background:#fff;display:flex;flex-direction:column;align-items:center;height:100dvh;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);direction:rtl;--welcome-content-width:min(calc(100% - 24px),456px)}
html body .clofit-welcome video{display:block;width:var(--welcome-content-width);height:auto;min-height:0;flex:none;object-fit:contain;background:#fff}
html body .clofit-welcome-actions{display:flex;justify-content:center;gap:12px;width:var(--welcome-content-width);box-sizing:border-box;flex:none;padding:16px 0 12px;background:#fff}
html body .clofit-welcome-actions button{font:inherit;font-size:16px;font-weight:600;min-width:0;min-height:48px;flex:1;border:1px solid #252025;border-radius:999px;background:#252025;color:#fff;padding:10px 12px;cursor:pointer;box-shadow:0 2px 5px #0000001f}
html body .clofit-welcome-actions [data-welcome-login]{background:#fff;color:#252025}
html body .clofit-welcome-actions button:active{box-shadow:0 1px 2px #0000001f}
html body .clofit-welcome-actions button:focus-visible{outline:2px solid currentColor;outline-offset:3px}
/* Keep both entry actions visible, including short mobile browser viewports. */
html body .clofit-welcome{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
html body .clofit-welcome-actions{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:1;padding:12px 0 calc(12px + env(safe-area-inset-bottom,0px));box-shadow:0 -8px 16px #00000008}
/* One quiet phone-shaped surface enclosing the entire welcome experience. */
html body .clofit-welcome{inset:8px 0;margin-inline:auto;width:calc(100% - 16px);max-width:480px;height:calc(100dvh - 16px);border:1px solid #eee;border-radius:28px;box-shadow:0 10px 30px #0000000a,0 0 0 100vmax #fff;--welcome-content-width:calc(100% - 24px)}
html body .clofit-welcome-actions{bottom:9px;width:min(calc(100% - 18px),478px);padding-inline:12px;border-radius:0 0 27px 27px}
html:root[data-theme="dark"] body .clofit-welcome{border-color:#383239;box-shadow:0 10px 30px #0004,0 0 0 100vmax #161317}

/* A full-width opaque sticky header keeps the logo visible without cropping the video. */
html body .clofit-welcome-heading{position:sticky;top:0;z-index:2;flex:none;box-sizing:border-box;width:100%;padding:18px 12px 12px;background:#fff}
html:root[data-theme="dark"] body .clofit-welcome-heading{background:#211c22}

/* Shared entry layout, matching the approved mobile welcome. */
html:root body .clofit-welcome{inset:0;width:100%;max-width:none;height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);background:#fff!important;color:#252025}
html:root body .clofit-welcome-heading{position:relative;top:auto;padding:24px 12px;background:#fff!important}
html body .clofit-welcome-content{flex:1;min-height:0;width:100%;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:0 16px}
html body .clofit-welcome-media{position:relative;width:min(100%,456px);margin:0 auto;border-radius:20px;overflow:hidden;isolation:isolate}
html body .clofit-welcome video{width:100%;height:auto;border-radius:20px}
html body .clofit-welcome-legal{width:min(100%,456px);margin:0 auto;padding-top:20px}
html body .clofit-welcome-actions{position:relative;bottom:auto;left:auto;transform:none;width:100%;max-width:488px;padding:16px;box-shadow:none;border-radius:0;background:#fff!important}
html body .clofit-welcome-actions button{white-space:nowrap}
html body .clofit-welcome-content:focus-visible{outline:2px solid #252025;outline-offset:-3px}
html.clofit-welcome-open body.account-body #show-account-types,
html.clofit-welcome-open body.account-body #open-login,
html.clofit-welcome-open body .app-header [aria-label="سجّل الآن"]{display:none!important}
html:root body #account-type-picker{padding-top:24px!important}
html:root body #account-type-picker .account-picker-brand{display:block;width:140px!important;margin:0 auto 36px 0!important}
html:root body #account-type-picker header{min-height:0;padding:0!important;margin-bottom:0!important}
html:root body #account-type-picker #registration-types{gap:24px!important}
html:root body #account-type-picker #account-type-title,
html:root body .auth-dialog[data-entry-mode="login"] #auth-title{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap;border:0}
html:root body .auth-dialog :is([data-auth-phone],[data-auth-secret]){font-size:18px!important;line-height:1.6}
html:root body .auth-dialog :is([data-auth-phone],[data-auth-secret]) input{font-size:16px!important}

/* Approved CLOFIT interface review, 10 October 2026. */
/* Hallmark component critique: hierarchy 4, spacing 4, typography 4, contrast 4, interaction 4, brand 4. */
html body .clofit-welcome {
  --welcome-surface: #fff;
  --welcome-ink: #252025;
  --welcome-gap: 20px;
  --welcome-radius: 20px;
  inset: 0; width: 100%; max-width: none; height: 100dvh; margin: 0;
  border: 0; border-radius: 0; box-shadow: none;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  overflow: clip; background: var(--welcome-surface) !important;
}
html body .clofit-welcome-heading {
  position: relative; top: auto; flex: none; z-index: 2;
  padding: 24px 12px; background: var(--welcome-surface) !important;
}
html body .clofit-welcome-content {
  flex: 1; min-height: 0; width: 100%; box-sizing: border-box;
  overflow-y: auto; overflow-x: clip; overscroll-behavior: contain;
  padding: 0 16px; scrollbar-width: thin;
}
html body .clofit-welcome-media {
  position: relative; width: min(100%, 456px); margin: 0 auto;
  border-radius: var(--welcome-radius); overflow: clip; isolation: isolate;
}
html body .clofit-welcome video {
  width: 100%; height: auto; display: block; border-radius: var(--welcome-radius);
}
html body .clofit-welcome-legal {
  width: min(100%, 456px); margin: 0 auto; padding-top: var(--welcome-gap);
}
html body .clofit-welcome-actions {
  position: relative; bottom: auto; left: auto; transform: none;
  width: 100%; max-width: 488px; flex: none; border-radius: 0;
  padding: 16px; box-shadow: none; background: var(--welcome-surface) !important;
}
html body .clofit-welcome-actions button { white-space: nowrap; }
html body .clofit-welcome-content:focus-visible { outline: 2px solid var(--welcome-ink); outline-offset: -3px; }
/* Account picker: centered title, with breathing room between both choices. */
html:root body #account-type-picker header {
  justify-content: center;
}
html:root body #account-type-picker h2 {
  width: 100%; text-align: center;
}
html:root body #account-type-picker #registration-types {
  gap: 24px !important;
}
/* Match the login heading and brand placement across account entry dialogs. */
html:root body #account-type-picker {
  --mobile-entry-title-size: 1rem;
  padding-top: 24px !important;
}
html:root body #account-type-picker .account-picker-brand {
  width: 140px !important; margin: 0 auto 24px 0 !important;
}
html:root body #account-type-picker header {
  display: block; min-height: 0 !important; padding: 0 !important;
  margin-bottom: 24px;
}
html:root body #account-type-picker h2 {
  text-align: right; font-size: var(--mobile-entry-title-size);
  font-weight: 500; line-height: 1.5; margin: 12px 0 16px;
}
html:root body .auth-dialog #auth-title { font-size: 1rem; }
html:root body .auth-dialog :is([data-auth-phone], [data-auth-secret]) {
  font-size: 18px !important; line-height: 1.6;
}
html:root body .auth-dialog :is([data-auth-phone], [data-auth-secret]) input {
  font-size: 16px !important;
}
/* Use the welcome entry actions instead of duplicate account-page links. */
html:root body.account-body #show-account-types,
html:root body.account-body #open-login,
html:root body .app-header [aria-label="سجّل الآن"] {
  display: none !important;
}
/* Keep dialog accessible names while removing duplicate visible titles. */
html:root body .auth-dialog #auth-title,
html:root body #account-type-picker #account-type-title {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
html:root body #account-type-picker header {
  margin-bottom: 0 !important;
}
/* A little more space below the picker wordmark before account choices. */
html:root body #account-type-picker .account-picker-brand {
  margin-bottom: 36px !important;
}

/* Compact account choices with a clear gap below the wordmark. */
html:root body #account-type-picker #registration-types{width:min(100%,280px)!important;margin:36px auto 0!important;gap:14px!important}
html:root body #account-type-picker #registration-types>button{width:100%!important;min-height:48px!important;height:48px!important;padding:10px 18px!important;font-size:16px!important;line-height:1.5!important;border-radius:999px!important}

html:root body #account-type-picker#account-type-picker button[data-ui-close][aria-label="إغلاق اختيار الحساب"]{position:absolute!important;inset:auto!important;top:6px!important;left:6px!important;right:auto!important;bottom:auto!important;width:44px!important;height:44px!important;margin:0!important;transform:none!important}

html:root body #account-type-picker#account-type-picker .auth-brand-row{position:static!important}
