/* ============================================================
   DCMS Portal — 07 views
   Page-level composition: auth, page headers, servers install,
   support list + thread, account.
   ============================================================ */

@layer views {
  /* ==================================================================
     Page header
     ================================================================== */
  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .page-title {
    font-size: var(--fs-2xl);
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.2;
  }

  .page-sub {
    margin-top: 4px;
    font-size: var(--fs-base);
    color: var(--text-muted);
  }

  @media (max-width: 900px) {
    .page-header {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--space-3);
    }
  }

  /* ==================================================================
     Auth (guest shell)
     ================================================================== */
  .auth-wrap {
    width: 100%;
    max-width: 440px;
  }

  .auth-card {
    position: relative;
    overflow: hidden;
    padding: var(--space-8) var(--space-7) var(--space-7);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
  }

  /* Brand warmth as a soft amber aura behind the mark, fading into the
     card — replaces the old flat top-edge line. */
  .auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 190px;
    background: radial-gradient(72% 150px at 50% -12%, var(--accent-soft), transparent 74%);
    pointer-events: none;
  }

  .auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
  }

  .auth-brand .brand-name {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: var(--fs-lg);
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .auth-step {
    text-align: center;
  }

  .auth-title {
    font-size: var(--fs-xl);
    font-weight: 750;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-2);
  }

  .auth-hint {
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--space-5);
  }

  .auth-hint strong {
    color: var(--text);
    overflow-wrap: anywhere;
  }

  .auth-step .field {
    text-align: left;
  }

  .auth-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    font-size: var(--fs-sm);
  }

  .dot-sep {
    color: var(--text-faint);
    user-select: none;
  }

  .auth-foot {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
    line-height: 1.55;
    text-align: left;
  }

  .auth-foot .icon-sm {
    margin-top: 2px;
    color: var(--success-ink);
  }

  @media (max-width: 560px) {
    .auth-card {
      padding: var(--space-6) var(--space-5) var(--space-5);
    }
  }

  /* ==================================================================
     Servers: install card
     ================================================================== */
  .install-card {
    margin-bottom: var(--space-7);
  }

  .install-steps {
    display: grid;
    gap: 6px;
    margin: 0 0 var(--space-3);
    padding-left: 1.4em;
    font-size: var(--fs-base);
    color: var(--text);
  }

  .install-steps li::marker {
    color: var(--accent-ink);
    font-weight: 700;
  }

  .install-note {
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
  }

  /* ==================================================================
     Support: ticket list
     ================================================================== */
  .ticket-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
  }

  .ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    color: inherit;
    text-decoration: none;
    transition: transform var(--dur-quick) var(--ease-out),
      box-shadow var(--dur-quick) var(--ease-out),
      border-color var(--dur-quick) var(--ease-out);
  }

  .ticket-row:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
  }

  .ticket-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }

  .ticket-subject {
    font-weight: 650;
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ticket-meta {
    font-size: var(--fs-sm);
  }

  .ticket-row-side {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
  }

  @media (max-width: 560px) {
    .ticket-row {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--space-2);
    }

    .ticket-subject {
      white-space: normal;
    }
  }

  /* ==================================================================
     Support: ticket thread
     ================================================================== */
  .ticket-header {
    align-items: flex-start;
  }

  .ticket-title {
    overflow-wrap: anywhere;
  }

  .ticket-header-badges {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    padding-top: 6px;
  }

  .ticket-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .msg {
    max-width: 72%;
    padding: var(--space-4) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .msg-customer {
    align-self: flex-end;
    background: var(--accent-soft);
    border-color: var(--accent-border);
    border-bottom-right-radius: 6px;
  }

  .msg-admin {
    align-self: flex-start;
    background: var(--surface);
    border-bottom-left-radius: 6px;
  }

  .msg-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 6px;
    font-size: var(--fs-xs);
  }

  .msg-author {
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .msg-customer .msg-author {
    color: var(--accent-ink);
  }

  .msg-admin .msg-author {
    color: var(--text);
  }

  .msg-time {
    white-space: nowrap;
  }

  .msg-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: var(--fs-base);
    line-height: 1.6;
  }

  @media (max-width: 900px) {
    .msg {
      max-width: 92%;
    }
  }

  /* -- reply --------------------------------------------------------- */
  .reply-card {
    margin-bottom: var(--space-6);
  }

  .reply-card .muted {
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
  }

  .reply-actions {
    display: flex;
    justify-content: flex-end;
  }

  /* ==================================================================
     Servers: connect-server modal (one-time claim code)
     ================================================================== */
  .connect-intro {
    margin-bottom: var(--space-4);
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--text-muted);
  }

  .connect-intro strong {
    color: var(--text);
    overflow-wrap: anywhere;
  }

  .connect-steps {
    margin-bottom: var(--space-4);
  }

  .connect-code {
    margin-bottom: var(--space-4);
  }

  .connect-code .code-line {
    letter-spacing: 0.06em;
    font-weight: 650;
  }

  .connect-note {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
  }

  /* ==================================================================
     Account
     ================================================================== */
  .account-card {
    max-width: 620px;
    margin-bottom: var(--space-5);
  }

  .account-card .muted {
    font-size: var(--fs-sm);
  }

  .account-email {
    font-size: var(--fs-md);
    font-weight: 650;
    margin: 2px 0 4px;
    overflow-wrap: anywhere;
  }

  /* -- billing summary ------------------------------------------------ */
  .billing-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--space-4);
    margin: 0 0 var(--space-3);
  }

  .billing-summary dt {
    font-size: var(--fs-2xs);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  .billing-summary dd {
    margin: 0;
    font-size: var(--fs-base);
    font-weight: 650;
  }

  .billing-note {
    margin-bottom: var(--space-4);
  }

  /* ==================================================================
     Dev billing simulator (mounted only when Stripe is unconfigured)
     ================================================================== */
  .dev-billing-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 720px;
  }

  .dev-billing-card .card-title .muted {
    font-size: var(--fs-sm);
    font-weight: 500;
  }

  .dev-billing-highlight {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
  }

  .dev-billing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
  }
}
