/* ==========================================================================
   Ray Grafix — Login + Client Portal. Mobile-first. Depends on tokens.css.
   Shares the onboarding language: charcoal canvas, apricot warmth, lavender
   as the single interactive accent, gold-green reserved for "complete".
   ========================================================================== */

.rgp, .rgp * { box-sizing: border-box; }
.rgp {
	margin: 0;
	min-height: 100dvh;
	background: var(--rg-bg);
	color: var(--rg-ink);
	font-family: var(--rg-font-body);
	font-size: var(--rg-text-md);
	line-height: var(--rg-leading-body);
	letter-spacing: -0.01em;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
.rgp a { color: inherit; }
.rgp-logo { display: inline-flex; align-items: center; color: var(--rg-ink); }
.rgp-logo svg { height: 20px; width: auto; display: block; }
.rgp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rgp-muted { color: var(--rg-muted); }
.rgp-meta { display: block; font-size: var(--rg-text-xs); color: var(--rg-faint); margin-top: 2px; }
.rgp-h1 { font-family: var(--rg-font-display); font-weight: var(--rg-weight-medium); font-size: var(--rg-display-3); line-height: var(--rg-leading-tight); letter-spacing: var(--rg-tracking-tight); margin: 0; }
.rgp-h1 em { font-family: var(--rg-font-serif); font-style: italic; color: var(--rg-accent); }
.rgp-h2 { font-family: var(--rg-font-display); font-weight: var(--rg-weight-medium); font-size: var(--rg-text-xl); margin: 0 0 var(--rg-space-4); letter-spacing: var(--rg-tracking-tight); }
.rgp-eyebrow { font-size: var(--rg-text-xs); font-weight: var(--rg-weight-semibold); letter-spacing: var(--rg-tracking-wide); text-transform: uppercase; color: var(--rg-muted); margin: 0 0 6px; }

/* --- Buttons + fields (shared) ---------------------------------------- */
.rgp-btn {
	appearance: none; font: inherit; cursor: pointer;
	font-weight: var(--rg-weight-semibold);
	border-radius: var(--rg-radius-pill);
	padding: 12px 22px; min-height: 46px;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	text-decoration: none;
	transition: all var(--rg-dur-fast) var(--rg-ease-out);
}
.rgp-btn-primary { background: var(--rg-accent); color: var(--rg-on-accent); border: 1px solid var(--rg-accent); }
.rgp-btn-primary:hover { background: var(--rg-accent-hover); border-color: var(--rg-accent-hover); }
.rgp-btn-ghost { background: transparent; color: var(--rg-ink-dim); border: 1px solid var(--rg-line-strong); }
.rgp-btn-ghost:hover { color: var(--rg-ink); border-color: var(--rg-accent-line); }
.rgp-btn-block { width: 100%; }
.rgp-btn-sm { padding: 8px 14px; min-height: 38px; font-size: var(--rg-text-sm); }

.rgp-field { position: relative; margin-bottom: var(--rg-space-4); }
.rgp-input {
	width: 100%; font: inherit; color: var(--rg-ink);
	background: var(--rg-surface); border: 1px solid var(--rg-line-strong);
	border-radius: var(--rg-radius-sm); padding: 22px 15px 9px;
	transition: border-color var(--rg-dur-fast), box-shadow var(--rg-dur-fast);
}
.rgp-input:focus { outline: none; border-color: var(--rg-accent); box-shadow: var(--rg-focus-ring); }
.rgp-input::placeholder { color: transparent; }
.rgp-label { position: absolute; left: 16px; top: 15px; color: var(--rg-muted); pointer-events: none; transform-origin: left top; transition: transform var(--rg-dur-fast) var(--rg-ease-out), color var(--rg-dur-fast); }
.rgp-input:focus + .rgp-label, .rgp-input:not(:placeholder-shown) + .rgp-label { transform: translateY(-9px) scale(0.78); color: var(--rg-accent); }
.rgp-remember { display: flex; align-items: center; gap: 8px; font-size: var(--rg-text-sm); color: var(--rg-ink-dim); margin: 4px 0 var(--rg-space-5); }
.rgp-remember input { accent-color: var(--rg-accent); width: 16px; height: 16px; }

.rgp-note { border-radius: var(--rg-radius-sm); padding: 11px 14px; font-size: var(--rg-text-sm); margin-bottom: var(--rg-space-4); }
.rgp-note-err { background: var(--rg-danger-soft); color: var(--rg-danger); border: 1px solid rgba(236,122,134,.3); }
.rgp-note-ok { background: var(--rg-success-soft); color: var(--rg-success); border: 1px solid rgba(155,208,122,.3); }
.rgp-note-admin { background: var(--rg-gold-soft); color: var(--rg-gold); border: 1px solid rgba(202,196,38,.3); max-width: var(--rg-shell); margin: 0 auto var(--rg-space-4); }

/* --- Login ------------------------------------------------------------ */
.rgp-auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--rg-gutter); }
.rgp-auth::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
	background: radial-gradient(60% 40% at 80% -5%, rgba(188,180,255,.10), transparent 70%); }
.rgp-auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--rg-surface-2); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-lg); padding: clamp(24px, 6vw, 38px); box-shadow: var(--rg-shadow-lg); }
.rgp-auth-title { font-family: var(--rg-font-display); font-weight: var(--rg-weight-medium); font-size: var(--rg-display-3); margin: 20px 0 6px; letter-spacing: var(--rg-tracking-tight); }
.rgp-auth-title em { font-family: var(--rg-font-serif); font-style: italic; color: var(--rg-accent); }
.rgp-auth-sub { color: var(--rg-ink-dim); margin: 0 0 var(--rg-space-5); }
.rgp-auth-foot { margin-top: var(--rg-space-5); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: var(--rg-text-sm); color: var(--rg-muted); }
.rgp-auth-foot a { color: var(--rg-accent); text-decoration: none; }
.rgp-auth-foot a:hover { text-decoration: underline; }

/* --- Topbar ----------------------------------------------------------- */
.rgp-topbar { position: sticky; top: 0; z-index: var(--rg-z-header);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: calc(12px + env(safe-area-inset-top)) var(--rg-gutter) 12px;
	background: color-mix(in srgb, var(--rg-bg) 88%, transparent); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rg-line); }
.rgp-topbar-actions { display: flex; align-items: center; gap: 10px; }
.rgp-bell { position: relative; appearance: none; cursor: pointer; width: 40px; height: 40px; border-radius: var(--rg-radius-pill); background: var(--rg-surface-2); border: 1px solid var(--rg-line); color: var(--rg-ink-dim); display: grid; place-items: center; }
.rgp-bell:hover { color: var(--rg-ink); border-color: var(--rg-accent-line); }
.rgp-bell-dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--rg-accent); color: var(--rg-on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--rg-bg); }

/* --- Shell + hero ----------------------------------------------------- */
.rgp-shell { max-width: var(--rg-shell); margin: 0 auto; padding: var(--rg-space-5) var(--rg-gutter) calc(var(--rg-space-9) + env(safe-area-inset-bottom)); }
.rgp-empty { text-align: center; padding: var(--rg-space-9) 0; display: grid; gap: 16px; place-items: center; }

.rgp-hero { background: linear-gradient(160deg, var(--rg-surface-2), var(--rg-surface)); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-lg); padding: clamp(20px, 5vw, 32px); }
.rgp-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rgp-code { font-family: var(--rg-font-mono); font-size: var(--rg-text-sm); letter-spacing: 0.06em; color: var(--rg-accent); background: var(--rg-accent-soft); border: 1px solid var(--rg-accent-line); border-radius: var(--rg-radius-pill); padding: 6px 12px; white-space: nowrap; }
.rgp-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.rgp-pill { font-size: var(--rg-text-xs); font-weight: var(--rg-weight-medium); color: var(--rg-ink-dim); background: var(--rg-surface-3); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-pill); padding: 5px 11px; }
.rgp-status { display: flex; align-items: flex-start; gap: 12px; margin-top: var(--rg-space-5); }
.rgp-status-dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 999px; background: var(--rg-accent); box-shadow: 0 0 0 4px var(--rg-accent-soft); }
.rgp-status-dot[data-stage="completed"] { background: var(--rg-gold); box-shadow: 0 0 0 4px var(--rg-gold-soft); }
.rgp-status-label { font-weight: var(--rg-weight-semibold); font-size: var(--rg-text-lg); }
.rgp-status-desc { margin: 2px 0 0; color: var(--rg-ink-dim); font-size: var(--rg-text-base); }
.rgp-progress { height: 6px; border-radius: 999px; background: var(--rg-line); margin-top: 16px; overflow: hidden; }
.rgp-progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rg-accent-active), var(--rg-accent)); transition: width var(--rg-dur-slow) var(--rg-ease-out); }
.rgp-next { margin: 12px 0 0; font-size: var(--rg-text-sm); color: var(--rg-muted); }

/* --- Columns + cards -------------------------------------------------- */
.rgp-cols { display: grid; grid-template-columns: 1fr; gap: var(--rg-space-4); margin-top: var(--rg-space-4); }
.rgp-col-main, .rgp-col-side { display: grid; gap: var(--rg-space-4); align-content: start; }
.rgp-card { background: var(--rg-surface-2); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-lg); padding: clamp(18px, 4vw, 24px); }

/* --- Timeline (vertical) ---------------------------------------------- */
.rgp-timeline { list-style: none; margin: 0; padding: 0; }
.rgp-tl { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 18px; }
.rgp-tl:last-child { padding-bottom: 0; }
.rgp-tl::before { content: ""; position: absolute; left: 13px; top: 22px; bottom: -4px; width: 2px; background: var(--rg-line); }
.rgp-tl:last-child::before { display: none; }
.rgp-tl-node { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; border: 2px solid var(--rg-line-strong); color: var(--rg-on-accent); background: var(--rg-surface); z-index: 1; }
.rgp-tl.is-done .rgp-tl-node { background: var(--rg-gold); border-color: var(--rg-gold); }
.rgp-tl.is-done::before { background: var(--rg-gold); opacity: .5; }
.rgp-tl.is-current .rgp-tl-node { background: var(--rg-accent); border-color: var(--rg-accent); box-shadow: 0 0 0 4px var(--rg-accent-soft); }
.rgp-tl-label { font-weight: var(--rg-weight-medium); display: flex; align-items: center; gap: 8px; }
.rgp-tl.is-todo .rgp-tl-label { color: var(--rg-muted); }
.rgp-tl-desc { margin: 3px 0 0; font-size: var(--rg-text-sm); color: var(--rg-ink-dim); }
.rgp-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--rg-on-accent); background: var(--rg-accent); border-radius: 999px; padding: 2px 8px; }

/* --- Updates + activity ----------------------------------------------- */
.rgp-update { padding: 14px 0; border-bottom: 1px solid var(--rg-line); }
.rgp-update:last-child { border-bottom: none; padding-bottom: 0; }
.rgp-update h3 { margin: 0 0 4px; font-size: var(--rg-text-md); font-weight: var(--rg-weight-semibold); }
.rgp-update p { margin: 0; color: var(--rg-ink-dim); font-size: var(--rg-text-base); }
.rgp-activity { list-style: none; margin: 0; padding: 0; }
.rgp-activity li { display: grid; grid-template-columns: 12px 1fr; gap: 4px 10px; padding: 9px 0; }
.rgp-activity-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 999px; background: var(--rg-accent-line); grid-row: 1; }
.rgp-activity-msg { font-size: var(--rg-text-base); grid-column: 2; }
.rgp-activity .rgp-meta { grid-column: 2; margin-top: 0; }

/* --- Files ------------------------------------------------------------ */
.rgp-drop { border: 1.5px dashed var(--rg-line-strong); border-radius: var(--rg-radius); padding: 16px; text-align: center; cursor: pointer; font-size: var(--rg-text-sm); color: var(--rg-muted); transition: border-color var(--rg-dur-fast), background var(--rg-dur-fast); }
.rgp-drop:hover, .rgp-drop.is-drag, .rgp-drop:focus-visible { border-color: var(--rg-accent); background: var(--rg-accent-soft); color: var(--rg-ink-dim); outline: none; }
.rgp-drop-ico { display: block; color: var(--rg-accent); margin-bottom: 4px; }
.rgp-drop-browse { color: var(--rg-accent); font-weight: var(--rg-weight-semibold); }
.rgp-filelist { margin-top: 12px; display: grid; gap: 8px; }
.rgp-file { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; background: var(--rg-surface); border: 1px solid var(--rg-line); border-radius: var(--rg-radius-sm); padding: 9px 11px; }
.rgp-file-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--rg-surface-3); color: var(--rg-accent); }
.rgp-file-meta { min-width: 0; }
.rgp-file-name { font-size: var(--rg-text-base); font-weight: var(--rg-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rgp-file-sub { font-size: var(--rg-text-xs); color: var(--rg-muted); }
.rgp-file-dl, .rgp-iconbtn { appearance: none; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: transparent; border: 1px solid var(--rg-line); color: var(--rg-muted); text-decoration: none; }
.rgp-file-dl:hover, .rgp-iconbtn:hover { color: var(--rg-ink); border-color: var(--rg-accent-line); }
.rgp-file.is-uploading { opacity: .8; }
.rgp-file-bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--rg-line); overflow: hidden; margin-top: 4px; }
.rgp-file-bar > i { display: block; height: 100%; width: 0; background: var(--rg-accent); transition: width .15s linear; }

/* --- Notifications drawer --------------------------------------------- */
.rgp-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: var(--rg-z-overlay); }
.rgp-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); z-index: var(--rg-z-drawer);
	background: var(--rg-surface-2); border-left: 1px solid var(--rg-line); box-shadow: var(--rg-shadow-lg);
	display: flex; flex-direction: column; transform: translateX(0);
	padding-top: env(safe-area-inset-top); }
.rgp-drawer[hidden], .rgp-scrim[hidden] { display: none; }
.rgp-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--rg-line); }
.rgp-drawer-head .rgp-h2 { margin: 0; }
.rgp-drawer-body { overflow-y: auto; padding: 12px 20px 24px; }
.rgp-noti { padding: 12px 0; border-bottom: 1px solid var(--rg-line); }
.rgp-noti:last-child { border-bottom: none; }
.rgp-noti strong { display: block; font-weight: var(--rg-weight-semibold); }
.rgp-noti p { margin: 3px 0 0; color: var(--rg-ink-dim); font-size: var(--rg-text-base); }
.rgp-noti.is-unread { position: relative; padding-left: 14px; }
.rgp-noti.is-unread::before { content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; border-radius: 999px; background: var(--rg-accent); }
@media (prefers-reduced-motion: no-preference) {
	.rgp-drawer { animation: rgp-slide var(--rg-dur) var(--rg-ease-out); }
	@keyframes rgp-slide { from { transform: translateX(100%); } to { transform: none; } }
}

/* --- Focus ------------------------------------------------------------ */
.rgp :focus-visible { outline: 2px solid var(--rg-accent); outline-offset: 2px; border-radius: 6px; }

/* --- Desktop ---------------------------------------------------------- */
@media (min-width: 900px) {
	.rgp-cols { grid-template-columns: 1.7fr 1fr; align-items: start; }
	.rgp-h1 { font-size: var(--rg-display-2); }
}
