/*
    STORM :: portal

    Membership services. Dark chrome, a centred container, and a five column
    tile grid on the dashboard.
*/

.pt-root {
    background: var(--pt-bg);
    color: var(--pt-text);
}

/* -- Header ------------------------------------------------------------- */

.pt-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-4);
    padding: 12px var(--space-6);
    background: var(--pt-header);
    flex: none;
}

.pt-brand {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.pt-head-centre { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pt-head-title { font-size: var(--text-xl); font-weight: 700; white-space: nowrap; }

.pt-head-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-5); }

.pt-head-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pt-accent);
    font-family: inherit;
    font-size: var(--text-md);
    font-weight: 600;
    cursor: pointer;
}
.pt-head-link:hover { filter: brightness(1.25); }

/* -- Nav ---------------------------------------------------------------- */

.pt-nav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    background: var(--pt-nav);
    flex: none;
}

.pt-nav-item {
    position: relative;
    padding: 13px 18px;
    border: 0;
    background: none;
    color: #e9edf3;
    font-family: inherit;
    font-size: var(--text-md);
    cursor: pointer;
    white-space: nowrap;
}

.pt-nav-item + .pt-nav-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 28%;
    height: 44%;
    border-left: 1px solid rgba(255, 255, 255, .2);
}

.pt-nav-item:hover { background: rgba(255, 255, 255, .06); }

.pt-nav-item.is-active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    border-bottom: 3px solid #fff;
}

/* -- Body --------------------------------------------------------------- */

.pt-body { flex: 1 1 auto; padding: var(--space-5) var(--space-6) var(--space-10); }

.pt-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.pt-content { display: flex; flex-direction: column; gap: var(--space-5); }

/* -- Breadcrumb --------------------------------------------------------- */

.pt-crumb-bar { flex: none; }

.pt-crumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--pt-surface);
}

.pt-crumb-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--pt-text);
    font-family: inherit;
    font-size: var(--text-md);
    cursor: pointer;
}
.pt-crumb-link:hover { text-decoration: underline; }

.pt-crumb-sep { color: var(--pt-muted); }
.pt-crumb-current { color: var(--pt-muted); font-size: var(--text-md); }

/* -- Greeting ----------------------------------------------------------- */

.pt-greeting {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--pt-surface);
}

.pt-greeting-badge {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
    flex: none;
}

.pt-greeting-name { font-size: var(--text-xl); font-weight: 700; }
.pt-greeting-sub { font-size: var(--text-base); font-style: italic; color: var(--pt-muted); }

.pt-switcher { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.pt-switcher label { color: var(--pt-muted); }
.pt-switcher select {
    background: #2b2b2b;
    border-color: #3d3d3d;
    color: var(--pt-text);
}

/* -- Dashboard grid ----------------------------------------------------- */

.pt-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
}

.pt-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    aspect-ratio: 1 / 1;
    padding: var(--space-4);
    border: 0;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}

.pt-tile:hover { transform: translateY(-2px); filter: brightness(1.1); }

.pt-tile-icon { display: grid; place-items: center; }
.pt-tile-label { font-size: var(--text-md); font-weight: 700; }

.pt-tile-teal { background: var(--tone-teal); }
.pt-tile-steel { background: var(--tone-steel); }
.pt-tile-orchid { background: var(--tone-orchid); color: #2a2130; }
.pt-tile-amber { background: var(--tone-amber); color: #2b2005; }
.pt-tile-light { background: var(--tone-light); color: #1a1a1a; }
.pt-tile-slate { background: var(--tone-slate); }

/*
    The tasks panel is placed explicitly at column 3, spanning two rows. The
    tiles are auto placed, so they flow around it and reproduce the
    reference layout without any per tile positioning.
*/
.pt-tasks {
    grid-column: 3;
    grid-row: 1 / span 2;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    background: var(--tone-orchid);
    color: #2a2130;
    cursor: default;
    overflow: hidden;
}
.pt-tasks:hover { transform: none; filter: none; }

.pt-tasks-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    font-size: var(--text-lg);
    font-weight: 700;
    color: #fff;
}

.pt-tasks-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    min-height: 90px;
}

.pt-task {
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .35);
    color: #2a2130;
    font-family: inherit;
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
}
.pt-task:hover { background: rgba(255, 255, 255, .6); }

.pt-tasks-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 12px 16px;
    border: 0;
    background: rgba(0, 0, 0, .12);
    color: #2a2130;
    font-family: inherit;
    font-size: var(--text-base);
    cursor: pointer;
}
.pt-tasks-foot:hover { background: rgba(0, 0, 0, .2); }

/* -- Cards -------------------------------------------------------------- */

.pt-card {
    border-radius: var(--radius);
    background: var(--pt-surface);
    overflow: hidden;
}

.pt-narrow { max-width: 760px; }

.pt-card-head {
    padding: 16px 20px 12px;
    font-size: var(--text-lg);
    font-weight: 700;
    border-bottom: 1px solid var(--pt-border);
}

.pt-card-body { padding: 18px 20px; }
.pt-card-body.stack { display: flex; flex-direction: column; gap: var(--space-4); }

.pt-section-title { font-size: var(--text-2xl); font-weight: 700; }

.pt-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
}

/* Dark surfaces need the table borders lifting out of near black. */
.pt-card .table th { border-bottom-color: var(--pt-border); color: var(--pt-muted); opacity: 1; }
.pt-card .table td { border-bottom-color: rgba(255, 255, 255, .06); }
.pt-card .table .clickable:hover td { background: rgba(255, 255, 255, .05); }

.pt-card input[type="text"],
.pt-card input[type="number"],
.pt-card input[type="date"],
.pt-card input[type="time"],
.pt-card select,
.pt-card textarea {
    background: #2b2b2b;
    border-color: #3d3d3d;
    color: var(--pt-text);
}

.pt-card input::placeholder, .pt-card textarea::placeholder { color: #7c7c7c; }

/* -- Detail lists ------------------------------------------------------- */

.pt-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.pt-detail-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pt-muted);
    margin-bottom: 3px;
}

.pt-detail-value { font-size: var(--text-md); font-weight: 600; }

.pt-list-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.pt-list-row:last-child { border-bottom: 0; }

/* -- Forms hub ---------------------------------------------------------- */

.pt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.pt-form-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--pt-surface);
}

.pt-form-title { font-size: var(--text-lg); font-weight: 700; line-height: 1.3; }
.pt-form-state { font-size: var(--text-base); }

.pt-form-rule {
    margin: 4px 0 6px;
    border-top: 1px solid var(--pt-border);
}

/* Push the button pair to the bottom so cards with longer titles still
   line their actions up across a row. */
.pt-form-card .btn-block:first-of-type { margin-top: auto; }
.pt-form-card .btn-block + .btn-block { margin-top: 8px; }

/* -- Answers ------------------------------------------------------------ */

.pt-answer { padding-bottom: 10px; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.pt-answer:last-child { border-bottom: 0; padding-bottom: 0; }

.pt-answer-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .6;
    margin-bottom: 3px;
}

.pt-answer-value { font-size: var(--text-base); line-height: 1.55; white-space: pre-wrap; }

.pt-mail-body {
    padding: 14px;
    border-radius: var(--radius-sm);
    background: #f4f4f4;
    line-height: 1.6;
    white-space: pre-wrap;
    user-select: text;
}

/* -- Website link code -------------------------------------------------- */

.pt-linkcode {
    padding: 14px;
    border: 2px dashed #4a4a4a;
    border-radius: var(--radius-sm);
    background: #141414;
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: .3em;
    text-align: center;
    /* The whole point is to read it off one screen and type it on another. */
    user-select: text;
}

/* -- Metrics ------------------------------------------------------------ */

.pt-metric { font-size: var(--text-3xl); font-weight: 800; line-height: 1; }

.pt-progress {
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.pt-progress-fill { height: 100%; transition: width .3s ease; }

/* -- Narrow screens ----------------------------------------------------- */

@media (max-width: 1180px) {
    .pt-grid { grid-template-columns: repeat(3, 1fr); }
    .pt-tasks { grid-column: 3; grid-row: 1 / span 2; }
    .pt-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .pt-grid { grid-template-columns: repeat(2, 1fr); }
    /* Below three columns the explicit placement stops making sense, so the
       panel simply takes a full row of its own. */
    .pt-tasks { grid-column: 1 / -1; grid-row: auto; }
    .pt-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .pt-head-right { justify-content: center; }
}
