/*
 * Account pages of the new site (My Account, sign-in, password reset, orders). Everything is under
 * .acct / .acct-* / .signin-* so the template's own styles are untouched. Fonts come from the template;
 * the blue is the template's (#3e6d9b). Copied from the classic site's css/account.css, then adjusted.
 */
.acct {
	--acct-blue: #3e6d9b;
	--acct-blue-dark: #2f5579;
	--acct-rust: #AF4319;
	--acct-green: #3f9a6c;
	--acct-text: #2b2b2b;
	--acct-muted: #6b7280;
	--acct-line: #e5e7eb;
	--acct-bg: #f6f7f9;
	--acct-card: #fff;
	--acct-radius: 10px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--acct-text);
	box-sizing: border-box;
}
.acct *, .acct *::before, .acct *::after { box-sizing: border-box; }
.acct a { color: var(--acct-blue); }
.acct a:hover { color: var(--acct-blue-dark); text-decoration: underline; }

/* Page head */
.acct-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5em 1em;
	margin-bottom: 1.5em;
	border-bottom: 1px solid var(--acct-line);
	padding-bottom: .75em;
}
.acct-head h1 { margin: 0; text-align: left; font-size: 30px; }
.acct-hello { color: var(--acct-muted); }

/* Layout: menu + content */
.acct-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2em; align-items: start; }
.acct-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 1em; }
.acct-nav a {
	display: block;
	padding: .65em .9em;
	border-radius: 8px;
	color: var(--acct-text);
	font-weight: 600;
	text-decoration: none;
}
.acct-nav a .fa { color: var(--acct-muted); margin-right: .35em; }
.acct-nav a:hover { background: var(--acct-bg); color: var(--acct-blue); text-decoration: none; }
.acct-nav a.active { background: var(--acct-blue); color: #fff; }
.acct-nav a.active .fa { color: #fff; }
.acct-main { min-width: 0; }
.acct-title { font-size: 24px; margin: 0 0 .8em; }
.acct-subtitle { font-size: 18px; font-weight: 600; margin: 1.5em 0 .6em; }

/* Cards */
.acct-card {
	background: var(--acct-card);
	border: 1px solid var(--acct-line);
	border-radius: var(--acct-radius);
	padding: 1.1em 1.25em;
	margin-bottom: 1.25em;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.acct-card-flush { padding: 0; overflow-x: auto; }
.acct-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; margin-bottom: .6em; }
.acct-card-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.acct-empty { color: var(--acct-muted); margin: .25em 0; }
.acct-muted { color: var(--acct-muted); font-size: 13px; }

/* Stat tiles */
.acct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1em; margin-bottom: 1.25em; }
.acct-stat {
	background: var(--acct-card);
	border: 1px solid var(--acct-line);
	border-radius: var(--acct-radius);
	padding: 1em 1.1em;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.acct-stat-num { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--acct-blue); }
.acct-stat-date { font-size: 22px; padding: .2em 0 .15em; }
.acct-stat-label { font-weight: 700; margin-top: .2em; }
.acct-stat-note { color: var(--acct-muted); font-size: 13px; margin-top: .25em; }

/* Notices */
.acct-alert {
	display: flex;
	gap: .8em;
	align-items: flex-start;
	padding: .85em 1.1em;
	border-radius: var(--acct-radius);
	margin-bottom: 1em;
	border: 1px solid;
}
.acct-alert .fa { font-size: 18px; margin-top: .1em; }
.acct-alert-warn { background: #fff8e6; border-color: #f3d98b; color: #6b4e00; }
.acct-alert-danger { background: #fdf0ec; border-color: #efc1b1; color: #7a2e12; }
.acct-alert a { font-weight: 700; }
.acct-ship-status { display: flex; gap: .8em; align-items: center; }
.acct-ship-status > .fa { font-size: 20px; color: var(--acct-blue); }

/* Status labels */
.acct-badge {
	display: inline-block;
	padding: .15em .6em;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	background: #eef0f3;
	color: #374151;
}
.acct-badge-pending { background: #eef0f3; color: #4b5563; }
.acct-badge-allocated { background: #e6eef7; color: var(--acct-blue-dark); }
.acct-badge-confirmed { background: #e3f4ea; color: #1f6e46; }
.acct-badge-ready { background: #fff1d6; color: #7a5200; }
.acct-badge-shipped { background: #e8e6f7; color: #4338a0; }
.acct-badge-completed { background: #f1f2f4; color: #6b7280; }
.acct-badge-declined { background: #fbe3dc; color: #96310f; }
.acct-badge-cancelled { background: #f1f2f4; color: #9ca3af; text-decoration: line-through; }
.acct-badge-open { background: #e3f4ea; color: #1f6e46; }
.acct-badge-closed { background: #fbe3dc; color: #96310f; }

/* Short order list (Overview) */
.acct-mini-list { list-style: none; margin: 0; padding: 0; }
.acct-mini-list li {
	display: grid;
	grid-template-columns: 2.5em minmax(0, 1fr) auto auto;
	gap: .75em;
	align-items: center;
	padding: .55em 0;
	border-top: 1px solid var(--acct-line);
}
.acct-mini-list li:first-child { border-top: 0; }
.acct-mini-qty { color: var(--acct-muted); font-weight: 700; }
.acct-mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-mini-date { color: var(--acct-muted); font-size: 13px; white-space: nowrap; }

/* Toolbar + segmented switch (Orders) */
.acct-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75em 1.5em; margin-bottom: 1em; }
.acct-toolbar-note { color: var(--acct-muted); }
.acct-segmented { display: inline-flex; border: 1px solid var(--acct-line); border-radius: 8px; overflow: hidden; background: #fff; }
.acct-segmented a { padding: .45em 1.1em; color: var(--acct-text); font-weight: 600; text-decoration: none; }
.acct-segmented a + a { border-left: 1px solid var(--acct-line); }
.acct-segmented a:hover { background: var(--acct-bg); text-decoration: none; }
.acct-segmented a.active { background: var(--acct-blue); color: #fff; }

/* Tables */
.acct-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.acct-table th {
	text-align: left;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--acct-muted);
	font-weight: 700;
	background: var(--acct-bg);
	padding: .7em .9em;
	border-bottom: 1px solid var(--acct-line);
}
.acct-table th small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.acct-table td { padding: .7em .75em; border-top: 1px solid var(--acct-line); vertical-align: middle; }
.acct-table th { padding-left: .75em; padding-right: .75em; }
.acct-table td .acct-muted { font-size: 12px; white-space: nowrap; }
.acct-table tbody tr:first-child td { border-top: 0; }
.acct-table tbody tr:hover { background: #fafbfc; }
.acct-table .num { text-align: right; white-space: nowrap; }
.acct-table .acct-wine { min-width: 14em; }
.acct-nowrap { white-space: nowrap; }
.acct-actions { text-align: right; white-space: nowrap; }

/* Buttons */
.acct .acct-btn, .acct-modal .acct-btn {
	display: inline-block;
	height: auto;
	padding: .5em 1.1em;
	border-radius: 8px;
	border: 1px solid var(--acct-line, #e5e7eb);
	background: #fff;
	color: var(--acct-text, #2b2b2b);
	font: 600 14px inherit;
	text-transform: none;
	letter-spacing: 0;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.3;
}
.acct .acct-btn:hover, .acct-modal .acct-btn:hover { border-color: #3e6d9b; color: #3e6d9b; text-decoration: none; }
.acct .acct-btn-sm { padding: .3em .8em; font-size: 13px; }
.acct .acct-btn-primary, .acct-modal .acct-btn-primary { background: #3e6d9b; border-color: #3e6d9b; color: #fff; }
.acct .acct-btn-primary:hover, .acct-modal .acct-btn-primary:hover { background: #2f5579; color: #fff; }

/* Pager */
.acct-pager { display: flex; justify-content: center; align-items: center; gap: 1.5em; margin: 0 0 1.5em; color: var(--acct-muted); }
.acct-pager a { font-weight: 700; }

/* Help fold-out */
.acct-help { margin: 1em 0; color: var(--acct-muted); font-size: 14px; }
.acct-help summary { cursor: pointer; font-weight: 600; color: var(--acct-blue); }
.acct-help dl { display: grid; grid-template-columns: max-content 1fr; gap: .5em 1em; margin: .9em 0 0; }
.acct-help dd { margin: 0; }
.acct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.acct-help ul { margin: .7em 0 0; padding-left: 1.2em; }
.acct-help li { margin-bottom: .35em; }
.acct-lead { color: #4b5563; margin: -.3em 0 1.25em; max-width: 46em; line-height: 1.5; }
.acct-alert-success { background: #ecf8f1; border-color: #b7e2c8; color: #1f5e3d; }

/* Form fields */
.acct-label, .acct-modal .acct-label { display: block; font-size: 13px; font-weight: 700; color: #4b5563; margin: 0 0 .3em; }
.acct .acct-input, .acct-modal .acct-input {
	width: 100%;
	height: auto;
	padding: .5em .7em;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font: 15px inherit;
	color: #1f2937;
	background: #fff;
	box-sizing: border-box;
}
.acct .acct-input:focus, .acct-modal .acct-input:focus { outline: 2px solid rgba(62, 109, 155, .35); border-color: #3e6d9b; }
.acct-inline { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.acct-inline .acct-input { flex: 1 1 14em; width: auto; }
.acct .acct-btn-danger { color: #96310f; border-color: #efc1b1; }
.acct .acct-btn-danger:hover { background: #fdf0ec; color: #7a2e12; border-color: #e3a48c; }
.acct .acct-btn:disabled { opacity: .55; cursor: default; }

/* Pickup */
.acct-appt { padding: .9em 0; border-top: 1px solid var(--acct-line); display: grid; grid-template-columns: minmax(12em, 16em) minmax(0, 1fr); gap: 1.2em; align-items: start; }
.acct-appt:first-of-type { border-top: 0; padding-top: .2em; }
.acct-appt-when { display: flex; gap: .7em; align-items: flex-start; }
.acct-appt-when > .fa { font-size: 22px; color: var(--acct-green); margin-top: .1em; }
.acct-day { padding: 0; overflow: hidden; }
.acct-day-head { background: var(--acct-bg); padding: .6em 1.1em; font-weight: 700; border-bottom: 1px solid var(--acct-line); }
.acct-slots { list-style: none; margin: 0; padding: 0; }
.acct-slot { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: .65em 1.1em; border-top: 1px solid var(--acct-line); }
.acct-slot:first-child { border-top: 0; }
.acct-slot form { margin: 0; }
.acct-slot-time { font-weight: 600; }
.acct-slot.is-full .acct-slot-time { color: var(--acct-muted); font-weight: 400; }
.acct-slot.is-mine { background: #f3fbf6; }

/* Shipping */
.acct-card-intro { margin: 0 0 1em; line-height: 1.5; }
.acct-card-head-pad { padding: 1em 1.25em 0; }
.acct-choice { border: 0; padding: 0; margin: 0 0 1em; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8em; }
.acct-choice-opt { display: flex; gap: .7em; align-items: flex-start; border: 1px solid var(--acct-line); border-radius: 8px; padding: .8em 1em; cursor: pointer; }
.acct-choice-opt:has(input:checked) { border-color: var(--acct-blue); background: #f2f6fa; box-shadow: 0 0 0 1px var(--acct-blue) inset; }
.acct-choice-opt input { margin-top: .3em; }
.acct-fields { border: 0; padding: 0; margin: 0 0 1em; }
.acct-fields[hidden] { display: none; }
.acct-fields-title { font-weight: 700; margin-bottom: .6em; padding: 0; }
.acct-check { display: inline-flex; gap: .5em; align-items: center; margin: 0 0 .9em; cursor: pointer; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8em 1em; margin-bottom: .6em; }
.acct-grid-2 { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 1em; }
.acct-span2 { grid-column: 1 / -1; }
.acct .acct-input.is-invalid { border-color: #c2410c; outline: 2px solid rgba(194, 65, 12, .2); }
.acct fieldset[disabled] { opacity: .65; }
.acct-ranges { list-style: none; margin: 0 0 1em; padding: 0; }
.acct-ranges li { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: .55em 0; border-top: 1px solid var(--acct-line); }
.acct-ranges li:first-child { border-top: 0; }
.acct-ranges .fa { color: var(--acct-rust); margin-right: .3em; }
.acct-ranges form { margin: 0; }
.acct-range-form { display: flex; gap: .8em; align-items: flex-end; flex-wrap: wrap; }
.acct-range-form > div { flex: 0 1 11em; }
.acct-help h4 { margin: 1em 0 .3em; color: var(--acct-text); font-size: 15px; }
.acct-help p { margin: 0 0 .6em; line-height: 1.5; }

/* Retail Rack */
.acct-wines { display: grid; gap: 1em; }
.acct-wine { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1em; align-items: start; margin: 0; }
.acct-wine:has(.acct-wine-img) { grid-template-columns: 90px minmax(0, 1fr) auto; }
.acct-wine-img { width: 90px; height: 120px; object-fit: contain; border-radius: 6px; background: var(--acct-bg); }
.acct-wine-name { margin: 0 0 .35em; font-size: 17px; font-weight: 700; line-height: 1.3; }
.acct-wine-prices { display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; }
.acct-wine-fpp { font-size: 20px; font-weight: 700; color: var(--acct-blue); }
.acct-wine-left { color: var(--acct-rust); font-size: 13px; font-weight: 700; margin-top: .3em; }
.acct-wine-desc { margin-top: .6em; font-size: 14px; color: #374151; }
.acct-wine-desc summary { cursor: pointer; color: var(--acct-blue); font-weight: 600; }
.acct-wine-desc > div { margin-top: .5em; line-height: 1.55; }
.acct-wine-desc p { margin: 0 0 .6em; }

/* Settings: card */
.acct-current-pw { border-top: 1px dashed var(--acct-line); padding-top: .8em; }
.acct-cardbox { border-top: 1px solid var(--acct-line); margin: .6em 0 1em; padding-top: 1em; }
.acct-cardbox-now { display: flex; gap: .7em; align-items: center; background: var(--acct-bg); border-radius: 8px; padding: .7em .9em; margin-bottom: 1em; }
.acct-cardbox-now > .fa { font-size: 20px; color: var(--acct-blue); }
.acct-card-fields { display: grid; grid-template-columns: minmax(0, 1fr) 6em 7em 5.5em; gap: .6em; margin-bottom: .5em; }

/* Pop-up window */
.acct-modal {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 1000;
	font-family: inherit;
}
.acct-modal[hidden] { display: none; }
.acct-modal-box {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.acct-modal-wide .acct-modal-box { max-width: 860px; height: calc(100vh - 64px); }
.acct-modal-head { display: flex; justify-content: space-between; align-items: center; padding: .9em 1.2em; border-bottom: 1px solid #e5e7eb; }
.acct-modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.acct-modal-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; padding: 0 .2em; }
.acct-modal-body { padding: 1em 1.2em; overflow: auto; flex: 1; }
.acct-modal-wide .acct-modal-body { padding: 0; }
.acct-modal-frame { width: 100%; height: 100%; border: 0; display: block; }
.acct-modal-foot { display: flex; justify-content: flex-end; gap: .6em; padding: .8em 1.2em; border-top: 1px solid #e5e7eb; }
body.acct-modal-open { overflow: hidden; }

/* Section menu button (phones and tablets only) */
.acct-nav-toggle { display: none; }

/* Tablets and phones: the menu becomes a drop-down under one button showing the current section */
@media (max-width: 900px) {
	.acct-layout { grid-template-columns: minmax(0, 1fr); gap: 1em; position: relative; }
	.acct-nav-toggle {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: auto;
		padding: .75em 1em;
		border: 1px solid var(--acct-line);
		border-radius: 10px;
		background: #fff;
		color: var(--acct-text);
		font: 700 16px inherit;
		text-transform: none;
		letter-spacing: 0;
		cursor: pointer;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	}
	.acct-nav-toggle .fa { color: var(--acct-blue); }
	.acct-nav-caret { transition: transform .2s; }
	.acct-nav-toggle[aria-expanded="true"] .acct-nav-caret { transform: rotate(180deg); }
	/* Without JavaScript the list simply shows; with it, it opens from the button */
	.acct-js .acct-nav { display: none; }
	.acct-js .acct-nav.open { display: flex; }
	.acct-nav {
		position: absolute;
		top: 3.4em;
		left: 0;
		right: 0;
		z-index: 50;
		background: #fff;
		border: 1px solid var(--acct-line);
		border-radius: 10px;
		padding: .4em;
		box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
	}
	.acct:not(.acct-js) .acct-nav { position: static; box-shadow: none; }
	.acct:not(.acct-js) .acct-nav-toggle { display: none; }
	.acct-nav a { padding: .8em 1em; font-size: 16px; }
}

/* Phones: tables become stacked cards */
@media (max-width: 640px) {
	.acct-head h1 { font-size: 24px; }
	.acct-stats { grid-template-columns: minmax(0, 1fr); }
	.acct-mini-list li { grid-template-columns: 2.2em minmax(0, 1fr) auto; }
	.acct-mini-date { display: none; }
	.acct-table thead { display: none; }
	.acct-table, .acct-table tbody, .acct-table tr, .acct-table td { display: block; width: 100%; }
	.acct-table tr { padding: .8em 1em; border-top: 1px solid var(--acct-line); }
	.acct-table tbody tr:first-child { border-top: 0; }
	.acct-table td { border: 0; padding: .15em 0; display: flex; justify-content: space-between; gap: 1em; text-align: right; }
	.acct-table td::before { content: attr(data-label); color: var(--acct-muted); font-size: 13px; text-align: left; }
	.acct-table td.acct-wine { display: block; text-align: left; font-weight: 700; font-size: 15px; padding-bottom: .4em; }
	.acct-table td.acct-wine::before, .acct-table td.acct-actions::before { content: none; }
	.acct-table td.acct-actions { justify-content: flex-start; padding-top: .5em; }
	.acct-help dl { grid-template-columns: minmax(0, 1fr); }
	.acct-appt { grid-template-columns: minmax(0, 1fr); gap: .6em; }
	.acct-choice, .acct-grid { grid-template-columns: minmax(0, 1fr); }
	.acct-wine, .acct-wine:has(.acct-wine-img) { grid-template-columns: minmax(0, 1fr); }
	.acct-wine-actions .acct-btn { width: 100%; text-align: center; }
	.acct-card-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.acct-card-fields .acct-cc-num { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ */
/* New site: page spacing under the template's fixed top menu          */
.acct-page main > section.acct-section { padding-top: 95px; }                 /* height of the fixed menu */
.acct-page main > section.acct-section > .container { padding-top: 40px; padding-bottom: 70px; }
.acct-narrow { max-width: 720px; margin: 0 auto; }
.acct-head h1, .acct-title, .acct-card-head h3, .acct-subtitle { text-transform: none; letter-spacing: 0; }
.acct input, .acct select, .acct button, .acct textarea, .signin-box input, .signin-box button { font-family: inherit; }
.acct table { margin: 0; }
.acct ul, .acct ol { padding-left: 0; }
.acct-help ul { padding-left: 1.2em; }

/* Sign-in, forgot / reset password, unsubscribe: a box on a picture band (site_form_stage() in lib/layout.php) */
.signin-box {
	max-width: 420px;
	margin: 40px auto;
	background: rgba(255, 255, 255, .96);
	border-radius: 12px;
	padding: 28px 28px 22px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
	color: #2b2b2b;
	text-align: left;
	font-size: 15px;
	line-height: 1.5;
}
.signin-box * { box-sizing: border-box; }
.signin-title { font-size: 26px; margin: 0 0 .3em; color: #3e6d9b; text-transform: none; letter-spacing: 0; }
.signin-sub { margin: 0 0 1.1em; color: #4b5563; }
.signin-form .acct-label { margin-top: .8em; }
.signin-form .acct-input { width: 100%; }
.signin-submit { width: 100%; margin-top: 1.3em; padding: .8em 1em; font-size: 16px; }
.signin-links { margin-top: 1em; text-align: center; font-size: 14px; }
.signin-box .acct-alert { margin-bottom: .8em; }
.signin-help { text-align: center; padding-top: 1.5em; padding-bottom: 1em; }
/* Sign-in page: the box sits in the page itself (not the fading header), on the same picture */
.signin-stage {
	background-color: #2f5579;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	padding: 50px 15px;
}
.signin-stage .signin-box { margin: 0 auto; }
.acct-page main > section.signin-section { padding-top: 0; }                   /* picture runs up under the menu */
.signin-section .signin-stage { padding-top: 145px; }

/* Order page */
.acct-order-wine { font-size: 20px; margin: 0 0 .4em; text-transform: none; letter-spacing: 0; }
.acct-order-form { margin: 1em 0; }
.acct-qty { width: 6em; }

/* Sign-up page (register.php) */
.acct-field-error { color: #c2410c; font-size: 13px; margin-top: 4px; }
.acct-register .acct-card { margin-bottom: 20px; }
.acct-register .g-recaptcha { margin: 0 0 16px; }
