/* ============================================================
   Login Page — Token Entry (home)
   Brand: text #333E52 | bg #EDEDED | card #FFFFFF | btn #2046E5
   ============================================================ */

:root {
    --primarycolor:          #333E52;
    --secondarycolor:        #F0F3FF;
    --tertiarycolor:         #CBD5E1;
    --bgcolor_btn_sav:       #2046E5;
    --bgcolor_btn_sav_hover: #1538C2;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #EDEDED;
    color: #333E52;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Background motif (2026-08-10): subtle network/node graphic behind the card, corner-anchored,
   low opacity so it never competes with the form. Lives at the webMobile docroot root (NOT
   param/{site}/), same generic non-per-client location confirmed in the prior diagnosis --
   applied identically to devdoctor's app/public_login/home/main.css. */
body::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 480px;
    height: 407px;
    background-image: url('motif-network.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.07;
    z-index: 0;
    pointer-events: none;
}
.page-header, .page-main, .page-footer {
    position: relative;
    z-index: 1;
}

/* ---- Page header ---- */
.page-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header .header-logo {
    /* Sizing fix (2026-07-26): 36px->30px (~17% reduction), scoped to this page's own
       main.css only -- so it sits more proportionally with the lang switcher next to it.
       Source image untouched, CSS-only change. */
    height: 30px;
    width: auto;
}

.lang-switcher {
    display: flex;
    gap: 6px;
}

.lang-switcher a {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: #94A3B8;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher a.active {
    background-color: #2046E5;
    color: #FFFFFF;
}

/* ---- Main / card area ---- */
.page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-container {
    background-color: #FFFFFF;
    border-radius: 24px;
    padding: 36px 32px 32px;
    box-shadow: 0 4px 24px rgba(51, 62, 82, 0.08);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.logo {
    height: 48px;
    width: auto;
    max-width: 220px;
    margin: 0 auto 24px;
    display: block;
}

h2 {
    color: #333E52;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 20px;
}

form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

form label {
    font-weight: 600;
    font-size: 0.8rem;
    text-align: left;
    margin: 12px 0 4px;
    color: #333E52;
    letter-spacing: 0.02em;
}

form input[type="text"],
form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.95rem;
    background-color: #F8FAFF;
    color: #333E52;
    outline: none;
    transition: border-color 0.2s;
}

form input[type="text"]:focus,
form input[type="email"]:focus {
    border-color: #2046E5;
    background-color: #FFFFFF;
}

form input::placeholder { color: #94A3B8; }

form button {
    width: 100%;
    padding: 14px;
    background-color: #2046E5;
    color: #FFFFFF;
    border: none;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 10px 20px -4px rgba(32, 70, 229, 0.25);
    transition: background-color 0.2s, transform 0.1s;
}

form button:hover  { background-color: #1538C2; }
form button:active { transform: scale(0.98); }

.field_required { color: #EF4444; margin-left: 2px; }

.info-message {
    font-size: 0.82rem;
    color: #64748B;
    background-color: #F0F3FF;
    padding: 10px 14px;
    border-radius: 10px;
    margin: 8px 0;
    text-align: left;
    line-height: 1.5;
}

/* ---- Footer ---- */
.page-footer {
    padding: 14px 20px;
    text-align: center;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.page-footer p {
    margin: 0;
    font-size: 0.72rem;
    color: #747474;
    line-height: 1.6;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.footer-logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-logo {
    height: 36px;
    width: auto;
}
.footer-brand {
    font-size: 0.85rem;
    color: #666;
}
.footer-disclaimer {
    font-size: 0.72rem;
    color: #747474;
    margin: 0;
}

/* Site-wide unification pass (2026-08-29, devdoctor/devmobile ONLY -- .pl-devsite, added to
   <body> by this page's own main.js). Base rule above is shared by all 4 hostnames and its
   literal #2046E5 was left untouched deliberately -- findel/drfindel keep their exact current
   button colour. */
.pl-devsite form button {
    background-color: #2450E6;
}
.pl-devsite form button:hover {
    background-color: #1836B8;
}
/* Stage 2 (2026-09-03): same corner motif as the doctor login (body::before, right:-60px) made the document
   60px wider than the viewport (measured scrollWidth 1004 vs 944). Pinned inside the edge on devsite;
   findel/drfindel keep the base rule. */
body.pl-devsite::before {
    top: 0;
    right: 0;
}

/* ==== UI POLISH 2026-10-08 (public-patient) ====
   Patient token entry (at_login), devsite layer only (body.pl-devsite). Style only: no markup, id, class, text
   or JS change. --ui-fx-* tokens (ui_base section 7) are read with fallbacks, so the values match that layer
   when it is present and stand alone when it is not. */

/* Header: same 544px column as the consent and questionnaire pages that follow (it jumped from x=22 to x=448
   at 1440), 16px gutters on phones, the questionnaire's 32px logo. */
body.pl-devsite .page-header {
	padding: 12px max(16px, calc(50% - 272px));
}
body.pl-devsite .page-header .header-logo {
	height: 32px;
}
/* Language picker: was an unstyled native select (black border, bold). */
body.pl-devsite .page-header .lang-select {
	font-family: var(--ui-font-family);
	font-size: var(--ui-small-size);
	font-weight: var(--ui-label-weight);
	min-height: 36px;
	padding: 6px 10px;
	border: 1px solid var(--ui-border-strong);
	border-radius: var(--ui-radius-button);
	background-color: var(--ui-surface);
	color: var(--ui-text-primary);
	cursor: pointer;
}
body.pl-devsite .page-header .lang-select:hover {
	border-color: var(--ui-text-muted);
}
body.pl-devsite .page-header .lang-select:focus-visible {
	outline: 2px solid var(--ui-fx-accent, var(--ui-brand-heading));
	outline-offset: 2px;
}

/* Card: label spacing, the input no longer touches 'Suivant' (ui_base's margin-top:0 beat this page's 20px),
   required asterisk in --ui-danger (4.83:1; #EF4444 was 3.76:1). */
body.pl-devsite .login-container form label {
	margin: 0 0 6px;
}
body.pl-devsite .login-container form button {
	margin-top: var(--ui-space-field-gap);
}
body.pl-devsite .login-container .field_required {
	color: var(--ui-danger);
}

/* Field focus ring (ui_base sets box-shadow:none !important on focus). */
body.pl-devsite .login-container form input:focus {
	box-shadow: 0 0 0 3px rgba(36, 80, 230, .16) !important;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	body.pl-devsite .login-container form input:focus {
		box-shadow: 0 0 0 3px var(--ui-fx-ring-soft, color-mix(in srgb, var(--ui-brand-primary) 18%, transparent)) !important;
	}
}
/* Invalid flag: send_code() writes style.border='1px solid red' on an empty token, but ui_base's
   `border: ... !important` hid it. send_code() clears it with style.border='', and the rule then stops matching. */
body.pl-devsite .login-container form input[style*='red'],
body.pl-devsite .login-container form input[style*='red']:focus {
	border-color: var(--ui-danger) !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, .14) !important;
}

/* Card elevation and press feedback, as on the doctor login. The base `form button:active{scale(.98)}` above
   was dead on every host because ui_base section 1 removes it. */
body.pl-devsite .page-main .login-container {
	box-shadow: var(--ui-fx-shadow-1, 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -12px rgba(16, 24, 40, .14)) !important;
}
body.pl-devsite .login-container form button {
	transition-property: color, background-color, border-color, box-shadow, transform !important;
	transition-duration: var(--ui-fx-dur-hover, .15s) !important;
	transition-timing-function: var(--ui-fx-ease-out, ease) !important;
}
body.pl-devsite .login-container form button:not(:disabled):active {
	transform: scale(var(--ui-fx-press-scale-wide, .98)) !important;
	transition-duration: var(--ui-fx-dur-press, .1s) !important;
}

/* HDS/RGPD footer line capped at a readable measure instead of running full width. */
body.pl-devsite .page-footer .footer-disclaimer {
	max-width: 720px;
	line-height: 1.5;
	text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
	body.pl-devsite .login-container form button {
		transition: none !important;
	}
	body.pl-devsite .login-container form button:not(:disabled):active {
		transform: none !important;
		filter: brightness(.94);
	}
}
/* ==== end UI POLISH 2026-10-08 (public-patient) ==== */
