/*
 * Change / set password page (/update-password) in the look of the /support portal and the
 * sign-in page: warm ivory page, a white card, one gold accent, Gilda Display + a Futura-style
 * sans, and the portal's near-black header and footer. Same palette as portal_login.css and
 * templates/includes/support_portal_nav.html.
 *
 * Pure styling: Frappe's own page, form and script are untouched, so the old/new/confirm
 * checks, the strength meter and the emailed reset-link flow behave exactly as before.
 * Everything is scoped to body[data-path="update-password"].
 */

body[data-path="update-password"] {
	--pw-gold: #D6B25E;
	--pw-gold-deep: #C29B45;
	--pw-link: #7a5d17;
	--pw-ink: #17191a;
	--pw-muted: #6f6c66;
	--pw-line: #d6d0c3;
	--pw-sans: "Futura Medium BT", "Futura", "Jost", "Century Gothic", "Trebuchet MS", sans-serif;
	--pw-serif: "Gilda Display", "Cormorant Garamond", Georgia, "Times New Roman", serif;
	background: #f3f0ea;
	font-family: var(--pw-sans);
}

/* Header and footer as on /support. */
body[data-path="update-password"] .navbar { background: #17191a !important; border-bottom: 1px solid #2c2f31 !important; box-shadow: none !important; }
body[data-path="update-password"] .navbar .nav-link,
body[data-path="update-password"] .navbar .navbar-brand,
body[data-path="update-password"] .navbar .dropdown-toggle { color: #ded7cd !important; }
body[data-path="update-password"] .navbar .navbar-toggler-icon { filter: invert(1); }
body[data-path="update-password"] .web-footer { background: #17191a !important; border-top: 0 !important; margin-top: 0 !important; }
body[data-path="update-password"] .web-footer,
body[data-path="update-password"] .web-footer a,
body[data-path="update-password"] .web-footer .footer-col-left,
body[data-path="update-password"] .web-footer .footer-col-right { color: #a9a398 !important; }

/* Footer sits at the bottom of a short page instead of leaving a strip of page below it. */
body[data-path="update-password"] { min-height: 100vh; display: flex; flex-direction: column; }
body[data-path="update-password"] .page-content-wrapper { background: transparent; }
body[data-path="update-password"] #page-update-password { flex: 1 0 auto; }
body[data-path="update-password"] main.container { width: 100%; max-width: 440px; }
body[data-path="update-password"] .page_content { padding-bottom: 48px; }
body[data-path="update-password"] .for-reset-password { width: 100%; max-width: none; margin: 0 auto; }

/* --- heading above the card ------------------------------------------------------------- */
body[data-path="update-password"] .for-reset-password .page-card-head { padding: max(6vh, 32px) 0 22px; text-align: center; }
body[data-path="update-password"] .for-reset-password .page-card-head h4 {
	font-family: var(--pw-serif); font-weight: 400; font-size: 30px; line-height: 1.2; letter-spacing: 0;
	color: var(--pw-ink); margin: 0;
}

/* --- the card ------------------------------------------------------------------------ */
body[data-path="update-password"] .for-reset-password .page-card {
	max-width: none; width: 100%; padding: 32px; margin: 0 auto;
	background: #fff; border: 1px solid #e2ddd2; border-radius: 8px;
	box-shadow: 0 1px 0 rgba(23, 25, 26, .03), 0 12px 32px rgba(23, 25, 26, .07);
}

/* --- fields ------------------------------------------------------------------------ */
body[data-path="update-password"] .page-card .form-group { margin-bottom: 14px; position: relative; }
body[data-path="update-password"] .page-card .form-control {
	height: 46px; margin-bottom: 0 !important; background: #fff; color: var(--pw-ink);
	font-family: var(--pw-sans); font-size: 15px;
	border: 1px solid var(--pw-line); border-radius: 6px; box-shadow: none;
}
body[data-path="update-password"] .page-card .form-control::placeholder { color: #9d998f; }
body[data-path="update-password"] .page-card .form-control:focus {
	border-color: var(--pw-gold-deep); box-shadow: 0 0 0 3px rgba(214, 178, 94, .3); background: #fff; outline: 0;
}
body[data-path="update-password"] .page-card .password-strength-indicator { margin-top: 8px; display: inline-block; padding-bottom: 0; font-size: 13px; }
/* Empty until the user types; Frappe fills it with the strength label. */
body[data-path="update-password"] .page-card .password-strength-indicator:empty { display: none; }

/* --- messages ------------------------------------------------------------------------- */
body[data-path="update-password"] .page-card .password-mismatch-message,
body[data-path="update-password"] .page-card .password-strength-message { color: var(--pw-muted) !important; font-size: 13px; line-height: 1.45; }

/* --- button ------------------------------------------------------------------------- */
body[data-path="update-password"] .page-card .btn-update {
	height: 46px; display: flex; align-items: center; justify-content: center; margin-top: 18px;
	font-family: var(--pw-sans); font-size: 15px; font-weight: 500; letter-spacing: .02em; border-radius: 6px;
	background: var(--pw-gold); border: 1px solid var(--pw-gold); color: var(--pw-ink);
}
body[data-path="update-password"] .page-card .btn-update:hover:not(:disabled),
body[data-path="update-password"] .page-card .btn-update:focus:not(:disabled) {
	background: var(--pw-gold-deep); border-color: var(--pw-gold-deep); color: var(--pw-ink);
}
/* Frappe keeps it disabled until the three fields agree and the strength check passes. */
body[data-path="update-password"] .page-card .btn-update:disabled { opacity: .5; }
body[data-path="update-password"] .page-card .btn:focus-visible,
body[data-path="update-password"] .page-card a:focus-visible { outline: 2px solid var(--pw-ink); outline-offset: 2px; }

/* The account is already made by the time anyone is on this page. */
body[data-path="update-password"] .sign-up-message { display: none; }

@media (max-width: 480px) {
	body[data-path="update-password"] .for-reset-password .page-card { padding: 24px 20px; }
	body[data-path="update-password"] .for-reset-password .page-card-head h4 { font-size: 24px; }
}
