/* Client portal (clientes.arkadia42.com).
   Same construction as the Raphael interface: a marble ground, floating panels with soft layered shadows,
   a display serif only in titles, and one accent (the Arkadia42 laurel) used sparingly. */
.portal-body, .portal-body *, .portal-body *::before, .portal-body *::after { box-sizing: border-box; }
.portal-body {
  --bg: #EDECE7;
  --surface: #FAF9F6;
  --panel: #F5F4F0;
  --ink: #1B1D24;
  --muted: #5A5E69;
  --line: rgba(27, 29, 36, 0.09);
  --line-soft: rgba(27, 29, 36, 0.06);
  --field: rgba(27, 29, 36, 0.16);
  --accent: #3F5A47;
  --accent-ink: #2F4636;
  --accent-soft: #E3EAE3;
  --bronze: #8A6A3F;
  --alert: #963E39;
  --shadow: 0 1px 2px rgba(27, 29, 36, 0.04), 0 14px 32px -16px rgba(27, 29, 36, 0.16);
  --shadow-lift: 0 1px 2px rgba(27, 29, 36, 0.05), 0 22px 40px -18px rgba(27, 29, 36, 0.24);
  --glass: linear-gradient(180deg, #557260 0%, #3F5A47 100%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 26px -12px rgba(63, 90, 71, 0.7);
  --display: "Cormorant Garamond", "Bodoni Moda", Didot, Georgia, serif;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Manrope", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.portal-body h1, .portal-body h2, .portal-body h3, .portal-body p { margin: 0; }
.portal-body a { color: var(--accent); }
.portal-body a:hover { color: var(--ink); }
.portal-body a:focus-visible, .portal-body button:focus-visible, .portal-body input:focus-visible, .portal-body textarea:focus-visible, .portal-body label:focus-within {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.pt-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .portal-body * { transition: none !important; } }

/* Shell: floating side panel and content */
.pt-shell { display: flex; align-items: stretch; min-height: 100vh; }
.pt-side {
  position: sticky; top: 16px; flex: 0 0 272px; align-self: flex-start;
  display: flex; flex-direction: column; gap: 28px;
  height: calc(100vh - 32px); margin: 16px 0 16px 16px; padding: 22px 14px 18px;
  border: 1px solid var(--line); border-radius: 28px; background: var(--panel); box-shadow: var(--shadow);
}
.pt-client { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.pt-client-text, .pt-me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pt-client-text strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pt-client-text small, .pt-me-text small { color: var(--muted); font-size: 12px; }
.pt-monogram {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; color: #FFFFFF; background: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
}
.pt-nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.pt-nav-item {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: 10px 14px; border-radius: 16px;
  color: #2C2F38 !important; font-weight: 500; text-decoration: none; transition: background .15s;
}
.pt-nav-item > span:first-child { display: inline-flex; align-items: center; gap: 12px; }
.pt-nav-item:hover { background: rgba(27, 29, 36, 0.04); }
.pt-nav-item.is-current {
  color: var(--accent-ink) !important; font-weight: 600;
  background: linear-gradient(135deg, rgba(63, 90, 71, 0.14) 0%, rgba(63, 90, 71, 0.04) 100%);
  box-shadow: inset 0 0 0 1px rgba(63, 90, 71, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px -14px rgba(63, 90, 71, 0.8);
}
.pt-nav-item.is-current::before {
  content: ""; position: absolute; left: -15px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.pt-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; color: #FFFFFF; background: var(--glass); box-shadow: var(--glass-shadow); font-size: 12px; font-weight: 700;
}
.pt-side-foot { display: flex; flex-direction: column; gap: 16px; }
.pt-me { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.pt-me-text { flex: 1; }
.pt-me-text strong { font-size: 14px; font-weight: 600; }
.pt-me-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-avatar {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; color: var(--accent-ink); background: var(--accent-soft); font-size: 12px; font-weight: 700;
}
.pt-signout { margin: 0; }
.pt-icon-button {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer;
}
.pt-icon-button:hover { color: var(--ink); background: rgba(27, 29, 36, 0.05); }
.pt-signature { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; font-size: 12px; }
.pt-signature a { color: var(--muted) !important; text-decoration: none; }
.pt-signature a:hover { color: var(--ink) !important; text-decoration: underline; }
.pt-logo { display: inline-block; line-height: 0; }
.pt-logo svg { display: block; width: 100%; height: auto; }
.pt-signature .pt-logo { width: 104px; opacity: 0.78; }

.pt-main { flex: 1 1 auto; min-width: 0; padding: 48px clamp(20px, 4vw, 56px) 72px clamp(20px, 3vw, 40px); }
.pt-container { max-width: 1060px; margin: 0 auto; }
.pt-flash { margin-bottom: 24px !important; padding: 12px 16px; border-radius: 14px; color: var(--accent-ink); background: var(--accent-soft); font-weight: 500; }
.pt-flash.is-alert { color: var(--alert); background: #F4E4E1; }

/* Page heads and sections */
.pt-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.pt-page-head > div { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.pt-page-head h1 { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 4vw, 48px); line-height: 1.04; letter-spacing: -0.01em; }
.pt-page-head p { color: var(--muted); font-size: 16px; }
.pt-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--muted) !important; font-size: 14px; font-weight: 500; text-decoration: none; }
.pt-back:hover { color: var(--ink) !important; }
.pt-section + .pt-section { margin-top: 40px; }
.pt-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px !important; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pt-section-title span { padding: 1px 8px; border-radius: 999px; background: rgba(27, 29, 36, 0.06); font-size: 12px; letter-spacing: 0; }
.pt-quiet { color: var(--muted); }
.pt-narrow { max-width: 760px; }

/* Buttons and fields */
.pt-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 14px; color: #FFFFFF !important; background: var(--glass); box-shadow: var(--glass-shadow);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s, filter .15s;
}
.pt-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pt-button-block { width: 100%; min-height: 52px; font-size: 16px; }
.pt-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.pt-field { display: flex; flex-direction: column; gap: 8px; }
.pt-field > label, .pt-label { font-size: 14px; font-weight: 600; }
.portal-body input[type="text"], .portal-body input[type="email"] {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--field); border-radius: 12px;
  color: var(--ink); background: #FFFFFF; font: inherit; font-size: 16px;
}
.portal-body input::placeholder, .portal-body textarea::placeholder { color: #7A7F8A; }
.pt-input-lg { min-height: 56px !important; font-size: 18px !important; }
.form-errors { margin-bottom: 18px; padding: 12px 16px; border-radius: 14px; color: var(--alert); background: #F4E4E1; }
.form-errors ul { margin: 4px 0 0; padding-left: 18px; }

/* Demand list */
.pt-demands { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pt-demand {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink) !important; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.pt-demand:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.pt-demands.is-quiet .pt-demand { background: rgba(250, 249, 246, 0.6); box-shadow: none; }
.pt-demand-icon {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 14px; color: var(--accent-ink); background: var(--accent-soft);
}
.pt-demand-icon.status-open { color: #6B4E26; background: #F1E6D4; }
.pt-demand-icon.status-waiting-client { color: #6B4A16; background: #F6E7C8; }
.pt-demand-icon.status-delivered, .pt-demand-icon.status-closed { color: var(--muted); background: rgba(27, 29, 36, 0.06); }
.pt-demand-main { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.pt-demand-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-demand-title strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.pt-demand-preview { overflow: hidden; color: var(--muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.pt-demand-meta { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 6px; }
.pt-demand-meta small { color: var(--muted); font-size: 12px; }
.pt-new { padding: 2px 9px; border-radius: 999px; color: #FFFFFF; background: var(--glass); box-shadow: var(--glass-shadow); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }

/* Empty states */
.pt-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 24px; text-align: center;
  border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow);
}
.pt-empty h2 { font-family: var(--display); font-weight: 500; font-size: 30px; }
.pt-empty p { max-width: 46ch; color: var(--muted); }
.pt-empty .pt-button { margin-top: 8px; }
.pt-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 18px; color: var(--accent-ink); background: var(--accent-soft); }

/* Demand page: conversation and details */
.pt-thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.pt-thread { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.pt-details { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.pt-card { padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.pt-card-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px !important; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pt-card-label span { padding: 1px 8px; border-radius: 999px; background: rgba(27, 29, 36, 0.06); letter-spacing: 0; }
.pt-details-note { margin-top: 12px !important; font-size: 14px; color: var(--muted); }
.pt-facts { display: grid; gap: 10px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.pt-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.pt-facts dt { color: var(--muted); }
.pt-facts dd { margin: 0; font-weight: 600; }
.pt-file-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pt-file-list a { display: flex; align-items: flex-start; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 12px; color: var(--ink) !important; font-size: 14px; text-decoration: none; }
.pt-file-list a:hover { background: rgba(27, 29, 36, 0.04); }
.pt-file-list svg { flex: none; margin-top: 1px; color: var(--muted); }
.pt-file-list span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.pt-file-list small { color: var(--muted); font-size: 12px; }

/* Composer */
.pt-reply { margin: 0; }
.pt-composer {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px 18px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lift);
}
.pt-composer:focus-within { border-color: rgba(63, 90, 71, 0.4); }
.pt-composer-text {
  width: 100%; min-height: 76px; padding: 6px 4px 0; border: 0; resize: vertical; outline: none;
  color: var(--ink); background: transparent; font: inherit; font-size: 16px; line-height: 1.55;
}
.portal-body .pt-composer-text:focus-visible { outline: none; }
.pt-composer-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pt-composer-files li { padding: 4px 10px; border-radius: 999px; background: rgba(27, 29, 36, 0.06); font-size: 13px; }
.pt-composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pt-attach {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; color: var(--ink); background: rgba(27, 29, 36, 0.05); font-size: 14px; font-weight: 600; cursor: pointer;
}
.pt-attach:hover { background: rgba(27, 29, 36, 0.08); }
.pt-composer-hint { flex: 1; color: var(--muted); font-size: 12px; }

/* Proposals */
.pt-proposals { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.pt-proposal {
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink) !important; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.pt-proposal:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pt-proposal-art { display: block; height: 128px; background: linear-gradient(160deg, #E5EAE3 0%, #F0EEE8 100%); }
.pt-proposal-art svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.pt-proposal-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.pt-proposal-kind { color: var(--bronze); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pt-proposal-body strong { font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.15; }
.pt-proposal-body small { color: var(--muted); font-size: 13px; }
.pt-proposal-open { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; color: var(--accent); font-size: 14px; font-weight: 600; }

/* Sign-in: painting on the whole page, glass bar and a white card */
.pt-auth { position: relative; display: flex; min-height: 100vh; overflow: hidden; background: #6E8A6C; }
.pt-auth-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.pt-auth-scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 18, 28, 0.80) 0%, rgba(14, 18, 28, 0.36) 38%, rgba(14, 18, 28, 0.05) 70%); }
.pt-auth-inner { position: relative; display: flex; flex: 1; flex-direction: column; gap: 32px; padding: clamp(14px, 2vw, 24px); }
.pt-auth-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; align-self: flex-start; max-width: 100%;
  padding: 8px 8px 8px 18px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 18px;
  background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.pt-auth-bar .pt-logo { width: 132px; }
.pt-auth-bar-label { padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 500; }
.pt-auth-bar-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; color: #FFFFFF !important; background: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.pt-auth-stage { display: flex; flex: 1; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.pt-auth-hero { display: flex; flex: 999 1 380px; flex-direction: column; gap: 16px; padding: 0 clamp(4px, 2vw, 24px) clamp(8px, 2vw, 24px); color: #FFFFFF; }
.pt-auth-hero h1 { max-width: 15ch; font-family: var(--display); font-weight: 500; font-size: clamp(42px, 5vw, 72px); line-height: 1.0; letter-spacing: -0.015em; }
.pt-auth-hero p { max-width: 46ch; color: #F1EFEA; font-size: 17px; }
.pt-auth-card {
  display: flex; flex: 0 1 440px; flex-direction: column; gap: 22px; align-self: center;
  padding: clamp(24px, 2.6vw, 36px); border-radius: 26px; background: #FFFFFF; box-shadow: 0 24px 60px rgba(14, 18, 28, 0.25);
}
.pt-auth-head { display: flex; flex-direction: column; gap: 8px; }
.pt-auth-head h2 { font-family: var(--display); font-weight: 500; font-size: 40px; line-height: 1.04; }
.pt-auth-head p { color: var(--muted); font-size: 15px; }
.pt-auth-note { color: var(--muted); font-size: 13px; }
.pt-auth-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; color: var(--accent-ink); background: var(--accent-soft); }
.pt-auth-client { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--panel); }
.pt-auth-client span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.pt-auth-client small { color: var(--muted); font-size: 12px; }

/* Smaller screens: the side panel becomes a top bar */
@media (max-width: 980px) {
  .pt-thread-layout { grid-template-columns: 1fr; }
  .pt-details { position: static; order: -1; }
}
@media (max-width: 820px) {
  .pt-shell { flex-direction: column; }
  .pt-side {
    position: static; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px;
    height: auto; margin: 12px 12px 0; padding: 12px; border-radius: 22px;
  }
  .pt-client { flex: 1 1 auto; padding: 0 4px; }
  .pt-nav { flex: 1 1 100%; flex-direction: row; order: 3; }
  .pt-nav-item { flex: 1; justify-content: center; }
  .pt-nav-item.is-current::before { display: none; }
  .pt-side-foot { flex: none; }
  .pt-me { padding: 0; border: 0; }
  .pt-me-text, .pt-avatar, .pt-signature { display: none; }
  .pt-main { padding: 28px 16px 56px; }
  .pt-page-head { margin-bottom: 24px; }
  .pt-demand { align-items: flex-start; padding: 16px; }
  .pt-demand-icon { display: none; }
  .pt-demand-preview { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .pt-auth-bar-label { display: none; }
  .pt-auth-card { flex-basis: 100%; }
}
