/*
 * Customer account area (spec §9).
 *
 * Uses the theme's brand tokens with fallbacks, same approach as the booking
 * widget, so the plugin renders sanely under any theme.
 */

.rsdf-acc {
	--acc-green: var(--rsdf-green-dark, #333B30);
	--acc-green-mid: var(--rsdf-green-mid, #8A9A5B);
	--acc-orange: var(--rsdf-orange, #DD5A28);
	--acc-cream: var(--rsdf-cream, #F1F0EB);
	--acc-white: var(--rsdf-white, #FFFFFF);
	--acc-line: rgba(51, 59, 48, 0.14);
	--acc-muted: rgba(28, 28, 26, 0.62);
	--acc-radius: 22px; /* matches .rsdf-card / .rsdf-hero-widget across the theme */

	max-width: 760px;
}

.rsdf-acc--login {
	max-width: 480px;
}

.rsdf-acc--login .rsdf-acc__panel h2 {
	margin-top: 0;
}

/* Shared white card — welcome banner, sidebar and every dashboard section all
   sit on this base treatment so the whole page reads as one system. */
.rsdf-acc__panel {
	background: var(--acc-white);
	border-radius: var(--acc-radius);
	padding: clamp(24px, 3vw, 32px);
	box-shadow: 0 4px 24px rgba(28, 28, 26, 0.06);
	/* Clears the fixed header + any active notice when a sidebar link jumps
	   here, same offset the page hero uses. */
	scroll-margin-top: calc(var(--rsdf-header-height-collapsed, 88px) + var(--rsdf-notice-height, 0px) + 24px);
}

.rsdf-acc__panel h3 {
	font-size: 1.05rem;
	margin: 0 0 18px;
	color: var(--acc-green);
}

.rsdf-acc__empty {
	color: var(--acc-muted);
	margin-bottom: 14px;
}

/* ── Dashboard layout — sidebar + content ───────────────────────────────── */

.rsdf-acc--dashboard {
	max-width: none;
}

/*
 * Sidebar links are same-page anchors (single-page dashboard, no separate
 * routes per section) — scrolled smoothly rather than jumping instantly.
 * scroll-behavior only takes effect on the actual scrolling box (html), and
 * this stylesheet is only ever enqueued on the account page itself (see
 * RSDF_Account::assets()), so this doesn't leak a global site-wide change.
 */
html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

.rsdf-acc__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

@media (min-width: 900px) {
	.rsdf-acc__layout {
		grid-template-columns: 260px 1fr;
		gap: 32px;
	}
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.rsdf-acc__sidebar {
	background: var(--acc-white);
	border-radius: var(--acc-radius);
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(28, 28, 26, 0.06);
}

@media (min-width: 900px) {
	.rsdf-acc__sidebar {
		position: sticky;
		top: calc(var(--rsdf-header-height-collapsed, 88px) + var(--rsdf-notice-height, 0px) + 24px);
	}
}

.rsdf-acc__sidebar-head {
	background: var(--acc-green);
	color: var(--acc-white);
	padding: 22px 20px;
}

.rsdf-acc__sidebar-head strong {
	display: block;
	font-family: var(--rsdf-font-display, inherit);
	font-size: 1.05rem;
	font-weight: 500;
	margin-bottom: 4px;
}

.rsdf-acc__sidebar-head span {
	display: block;
	font-size: 0.8rem;
	opacity: 0.75;
	word-break: break-word;
}

.rsdf-acc__nav {
	list-style: none;
	margin: 0;
	padding: 10px 0;
}

.rsdf-acc__nav a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	border-left: 3px solid transparent;
	color: var(--acc-green);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	transition: background-color var(--rsdf-duration, 200ms) var(--rsdf-ease, ease), border-color var(--rsdf-duration, 200ms) var(--rsdf-ease, ease);
}

.rsdf-acc__nav a:hover {
	background: var(--acc-cream);
	border-left-color: var(--acc-orange);
}

.rsdf-acc__nav .rsdf-acc__icon {
	flex-shrink: 0;
	opacity: 0.8;
}

.rsdf-acc__nav-signout {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--acc-line);
}

.rsdf-acc__nav-signout a {
	color: var(--acc-muted);
	font-weight: 400;
}

/* ── Main column ─────────────────────────────────────────────────────────── */

.rsdf-acc__main {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.rsdf-acc__welcome {
	background: linear-gradient(135deg, var(--acc-green), #232922);
	color: var(--acc-white);
	border-radius: var(--acc-radius);
	padding: clamp(24px, 3vw, 32px);
	scroll-margin-top: calc(var(--rsdf-header-height-collapsed, 88px) + var(--rsdf-notice-height, 0px) + 24px);
}

.rsdf-acc__welcome h2 {
	margin: 0 0 8px;
	font-size: clamp(1.3rem, 2vw, 1.6rem);
	font-weight: 400;
}

.rsdf-acc__welcome p {
	margin: 0;
	max-width: 520px;
	opacity: 0.82;
}

/* ── Quick links ─────────────────────────────────────────────────────────── */

.rsdf-acc__quicklinks {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 560px) {
	.rsdf-acc__quicklinks {
		grid-template-columns: repeat(3, 1fr);
	}
}

.rsdf-acc__quicklink {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--acc-white);
	border-radius: 16px;
	padding: 20px;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 4px 24px rgba(28, 28, 26, 0.06);
	transition: transform var(--rsdf-duration, 200ms) var(--rsdf-ease, ease);
}

.rsdf-acc__quicklink:hover {
	transform: translateY(-2px);
}

.rsdf-acc__quicklink-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--acc-green);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--acc-white);
}

.rsdf-acc__quicklink strong {
	font-family: var(--rsdf-font-display, inherit);
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--acc-green);
}

.rsdf-acc__quicklink span:not(.rsdf-acc__quicklink-icon) {
	font-size: 0.8rem;
	color: var(--acc-muted);
}

/* ── Notices ─────────────────────────────────────────────────────────────── */

.rsdf-acc__notice {
	padding: 12px 16px;
	border-radius: 8px;
	border-left: 4px solid;
	margin-bottom: 20px;
	font-size: 0.9rem;
}

.rsdf-acc__notice--success { background: #edf7ed; border-color: #4a7c4a; }
.rsdf-acc__notice--error { background: #fdeeea; border-color: var(--acc-orange); }

/* ── Booking cards ───────────────────────────────────────────────────────── */

.rsdf-acc__card {
	display: flex;
	gap: 20px;
	justify-content: space-between;
	flex-wrap: wrap;
	align-items: flex-start;
	background: var(--acc-cream);
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 12px;
}

.rsdf-acc__cardmain { flex: 1 1 260px; min-width: 0; }

.rsdf-acc__when { margin: 0 0 4px; }
.rsdf-acc__when strong { display: block; font-size: 1.05rem; }
.rsdf-acc__when span { font-variant-numeric: tabular-nums; }

.rsdf-acc__meta {
	margin: 0;
	font-size: 0.85rem;
	color: var(--acc-muted);
}

/* The gate code is the thing they open this page to find on the way there,
   so it gets to be the most prominent element on the card. */
.rsdf-acc__code {
	margin: 12px 0 0;
	padding: 10px 14px;
	background: var(--acc-green);
	color: #fff;
	border-radius: 8px;
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
}

.rsdf-acc__code span {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.8;
}

.rsdf-acc__code strong {
	font-size: 1.5rem;
	letter-spacing: 0.12em;
	font-variant-numeric: tabular-nums;
}

.rsdf-acc__cardactions {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: stretch;
	max-width: 220px;
}

.rsdf-acc__inline { display: inline; margin: 0; }

.rsdf-acc__hint {
	font-size: 0.78rem;
	color: var(--acc-muted);
	margin: 0;
	line-height: 1.4;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.rsdf-acc__form { display: block; max-width: 420px; }

.rsdf-acc__form label {
	display: block;
	font-weight: 600;
	font-size: 0.85rem;
	margin: 14px 0 4px;
}

.rsdf-acc__form input[type="text"],
.rsdf-acc__form input[type="email"],
.rsdf-acc__form input[type="tel"] {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--acc-line);
	border-radius: 8px;
	font: inherit;
	font-size: 0.95rem;
}

.rsdf-acc__form button { margin-top: 16px; }

.rsdf-acc__alt {
	margin-top: 20px;
	font-size: 0.85rem;
}

.rsdf-acc__check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 0.85rem;
	margin: 12px 0;
	font-weight: 400;
}

/* ── Data / deletion ─────────────────────────────────────────────────────── */
/* No longer needs its own top border/padding — "Your data" is its own white
   .rsdf-acc__panel card now rather than sharing a column with the section
   above it. */

.rsdf-acc__danger {
	margin-top: 18px;
	border: 1px solid var(--acc-line);
	border-radius: 8px;
	padding: 14px 16px;
}

.rsdf-acc__danger summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
}

.rsdf-acc__danger p {
	font-size: 0.85rem;
	color: var(--acc-muted);
	line-height: 1.5;
	margin: 12px 0;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
/* Falls back gracefully if the theme's .rsdf-btn isn't present. */

.rsdf-acc .rsdf-btn {
	display: inline-block;
	text-align: center;
	border: 1px solid var(--acc-orange);
	background: var(--acc-orange);
	color: #fff;
	border-radius: 999px;
	padding: 0.6em 1.3em;
	font-size: 0.85rem;
	text-decoration: none;
	cursor: pointer;
}

.rsdf-acc .rsdf-btn--primary {
	background: var(--acc-orange);
	border-color: var(--acc-orange);
	color: #fff;
}

.rsdf-acc .rsdf-btn--quiet {
	background: var(--acc-orange);
	border-color: var(--acc-orange);
	color: #fff;
}

.rsdf-acc .rsdf-btn--danger {
	background: #8a2b0d;
	border-color: #8a2b0d;
	color: #fff;
}

@media (max-width: 600px) {
	.rsdf-acc__cardactions {
		max-width: none;
		width: 100%;
	}
}
