/* PawTrack - Base elements & primitive classes.
   Foundational, reusable styling that is safe to standardise across all
   PawTrack workflows. Higher-level page components live in the UI kits. */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body), sans-serif;
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--pt-ink-soft);
    /*background: var(--pt-bg);*/
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.pt-role-shell {
    --pt-role-accent: var(--pt-ink);
    --pt-role-accent-deep: var(--pt-ink-soft);
    --pt-role-focus: rgba(22, 50, 58, 0.28);
}

.pt-role-shell--professional {
    --pt-role-accent: var(--petprofessional);
    --pt-role-accent-deep: var(--petprofessional-deep);
    --pt-role-focus: var(--pt-focus-pro);
}

.pt-role-shell--parent {
    --pt-role-accent: var(--petparent);
    --pt-role-accent-deep: var(--petparent-deep);
    --pt-role-focus: var(--pt-focus-parent);
}

.pt-role-shell--admin,
.pt-role-shell--neutral {
    --pt-role-accent: var(--pt-ink);
    --pt-role-accent-deep: var(--pt-ink-soft);
    --pt-role-focus: rgba(22, 50, 58, 0.28);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading), sans-serif;
    color: var(--pt-ink);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin: 0 0 var(--space-3);
    font-weight: var(--weight-bold);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

p {
    margin: 0 0 var(--space-4);
    text-wrap: pretty;
}

a {
    color: var(--petprofessional-deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--petprofessional);
}

:focus-visible {
    outline: 3px solid var(--pt-focus-pro);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.form__note {
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--pt-ink-soft);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    box-sizing: border-box;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    border-radius: var(--radius-lg);
    border: 1px solid var(--pt-border);
    padding: 1rem;
    display: grid;
    gap: 0.35rem;
    background: var(--pt-info-soft);
    border-color: rgba(21, 128, 140, 0.24);
    margin-top: 16px;
}

.form__note__title {
    font-weight: var(--weight-bold);
    color: var(--pt-ink);
}

.form__note__body {
    color: var(--pt-ink-soft);
}

.form__note__title__wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form__note__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--petprofessional-deep);
    flex: 0 0 auto;
}

.pt-eyebrow {
    font-size: var(--text-xs);
    font-weight: var(--weight-heavy);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--pt-muted);
}

/* --- Layout --- */
.pt-section {
    padding-block: clamp(2rem, 5vw, 4rem);
}

.pt-container {
    width: min(var(--container-max), calc(100% - 2rem));
    margin-inline: auto;
}

/* --- Surfaces --- */
.pt-surface {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--radius-xl);
}

.pt-surface--soft {
    background: var(--pt-bg-soft);
}

.pt-surface--professional {
    background: var(--pt-cool-soft);
    border-color: rgba(21, 128, 140, 0.22);
}

.pt-surface--parent {
    background: var(--pt-warm-soft);
    border-color: rgba(203, 80, 58, 0.22);
}

/* --- Buttons --- */
.pt-button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font: inherit;
    font-weight: var(--weight-bold);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.pt-button:hover {
    transform: translateY(-1px);
}

.pt-button:active {
    transform: translateY(0);
}

.pt-button:focus-visible {
    outline: 3px solid var(--pt-focus-pro);
    outline-offset: 3px;
}

.pt-button:disabled,
.pt-button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pt-button--professional {
    color: #fff;
    background: linear-gradient(135deg, var(--petprofessional), var(--petprofessional-deep));
    box-shadow: var(--shadow-pro);
}

.pt-button--parent {
    color: #fff;
    background: linear-gradient(135deg, var(--petparent), var(--petparent-deep));
    box-shadow: var(--shadow-parent);
}

.pt-button--parent:focus-visible {
    outline-color: var(--pt-focus-parent);
}

.pt-button--neutral {
    color: var(--pt-ink);
    background: var(--pt-surface);
    border: 1px solid var(--pt-border-strong);
}

.pt-button--ghost {
    color: var(--pt-ink-soft);
    background: transparent;
}

.pt-button--ghost:hover {
    background: rgba(31, 42, 46, 0.05);
}

.pt-button--danger {
    color: #fff;
    background: var(--pt-danger);
}

.pt-button--sm {
    min-height: 44px;
    padding: 0.45rem 0.8rem;
    font-size: var(--text-sm);
}

.pt-button--lg {
    min-height: 52px;
    padding: 0.9rem 1.6rem;
    font-size: var(--text-lg);
}

/* --- Form fields --- */
.pt-field {
    display: grid;
    gap: 0.4rem;
}

.pt-label {
    font-weight: var(--weight-bold);
    color: var(--pt-ink);
    font-size: var(--text-sm);
}

.pt-input,
.pt-select,
.pt-textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--pt-border-strong);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    background: var(--pt-surface);
    color: var(--pt-ink);
    font: inherit;
}

.pt-textarea {
    min-height: 96px;
    resize: vertical;
}

.pt-input:focus,
.pt-select:focus,
.pt-textarea:focus {
    outline: 3px solid rgba(21, 128, 140, 0.25);
    border-color: var(--petprofessional);
}

.pt-help {
    color: var(--pt-muted);
    font-size: var(--text-sm);
}

.pt-error {
    color: var(--pt-danger);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
}

.pt-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--pt-ink-soft);
    font-weight: var(--weight-bold);
    line-height: var(--leading-normal);
}

.pt-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
    flex: none;
    accent-color: var(--pt-role-accent, var(--petprofessional));
}

.validation-summary-valid {
    display: none;
}

.pt-record-list {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    margin: 0;
    color: var(--pt-ink-soft);
}

.pt-record-list dt,
.pt-record-list dd {
    min-width: 0;
    margin: 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--pt-border);
}

.pt-record-list dt:first-of-type,
.pt-record-list dd:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.pt-record-list dt {
    color: var(--pt-muted);
    font-size: var(--text-sm);
    font-weight: var(--weight-heavy);
}

.pt-record-list dd {
    color: var(--pt-ink);
    overflow-wrap: anywhere;
}

.p-wrap:has(> .p-profile-page) {
    max-width: 1120px;
    margin-inline: 0 auto;
}

.p-profile-page {
    width: 100%;
}

.p-profile-status {
    margin-bottom: 18px;
}

.p-profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.p-profile-main,
.p-profile-side {
    display: grid;
    gap: 20px;
}

.p-profile-form-card .p-form {
    max-width: none;
}

.p-profile-form-card .pt-button {
    width: min(100%, 360px);
}

.p-profile-record .pt-record-list {
    grid-template-columns: 1fr;
}

.p-profile-record .pt-record-list dt {
    padding-bottom: 0.2rem;
}

.p-profile-record .pt-record-list dd {
    padding-top: 0;
}

.p-profile-record .pt-record-list dd:not(:last-child) {
    padding-bottom: 0.85rem;
}

.p-profile-rule {
    height: 1px;
    background: var(--pt-border);
}

.p-profile-full-button {
    width: 100%;
}

.p-profile-danger {
    border-color: rgba(201, 75, 75, 0.34);
}

/* --- Status indicators (always paired with text) --- */
.pt-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.65rem;
    font-size: var(--text-xs);
    font-weight: var(--weight-heavy);
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pt-status::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

.pt-status--success {
    color: var(--pt-success);
    background: var(--pt-success-soft);
    border-color: rgba(47, 143, 91, 0.24);
}

.pt-status--warning {
    color: var(--pt-warning);
    background: var(--pt-warning-soft);
    border-color: rgba(201, 133, 33, 0.24);
}

.pt-status--danger {
    color: var(--pt-danger);
    background: var(--pt-danger-soft);
    border-color: rgba(201, 75, 75, 0.24);
}

.pt-status--info {
    color: var(--petprofessional-deep);
    background: var(--pt-info-soft);
    border-color: rgba(21, 128, 140, 0.24);
}

.pt-status--pending {
    color: var(--pt-pending);
    background: var(--pt-pending-soft);
    border-color: rgba(124, 111, 95, 0.24);
}

/* --- Notices --- */
.pt-notice {
    border-radius: var(--radius-lg);
    border: 1px solid var(--pt-border);
    padding: 1rem;
    display: grid;
    gap: 0.35rem;
    background: var(--pt-surface);
}

.pt-notice--info {
    background: var(--pt-info-soft);
    border-color: rgba(21, 128, 140, 0.24);
}

.pt-notice--success {
    background: var(--pt-success-soft);
    border-color: rgba(47, 143, 91, 0.24);
}

.pt-notice--warning {
    background: var(--pt-warning-soft);
    border-color: rgba(201, 133, 33, 0.24);
}

.pt-notice--danger {
    background: var(--pt-danger-soft);
    border-color: rgba(201, 75, 75, 0.24);
}

.pt-notice__title {
    font-weight: var(--weight-bold);
    color: var(--pt-ink);
}

.pt-alert {
    border-radius: var(--radius-lg);
    border: 1px solid var(--pt-border);
    padding: 1rem;
    background: var(--pt-surface);
}

.pt-alert--success {
    background: var(--pt-success-soft);
    border-color: rgba(47, 143, 91, 0.24);
    color: var(--pt-ink);
}

.pt-alert--danger {
    background: var(--pt-danger-soft);
    border-color: rgba(201, 75, 75, 0.24);
    color: var(--pt-ink);
}

.pt-validation {
    display: block;
    margin-top: 6px;
    color: var(--pt-danger);
    font-size: 13px;
    line-height: 1.35;
}

.pt-validation:empty {
    display: none;
}

.pt-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pt-ink);
    font-size: 14px;
}

.pt-checkbox input {
    accent-color: var(--petprofessional);
}

/* --- Tables --- */
.pt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--text-sm);
}

.pt-table th {
    text-align: left;
    color: var(--pt-muted);
    font-weight: var(--weight-heavy);
    padding: 0.75rem;
    border-bottom: 1px solid var(--pt-border);
}

.pt-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--pt-border);
    vertical-align: top;
}

.pt-table tr:hover td {
    background: var(--pt-bg-soft);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .pt-button:hover,
    .pt-button:active,
    .pt-toast,
    .role:hover,
    .bk-btn:hover,
    .bk-btn:active {
        transform: none !important;
    }
}

@media (max-width: 520px) {
    .p-wrap:has(> .p-profile-page) {
        max-width: 880px;
        margin-inline: auto;
    }

    .p-profile-layout {
        grid-template-columns: 1fr;
    }

    .p-profile-form-card .pt-button {
        width: 100%;
    }

    .pt-record-list {
        grid-template-columns: 1fr;
    }

    .pt-record-list dt {
        padding-bottom: 0.2rem;
    }

    .pt-record-list dd {
        padding-top: 0;
    }

    .pt-record-list dd:not(:last-child) {
        padding-bottom: 0.75rem;
    }
}


/* --- Toasts (transient confirmations) --- */
.pt-toast-region {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 80;
    width: min(360px, calc(100vw - 40px));
}

.pt-toast {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    border-radius: var(--radius-lg);
    padding: 13px 14px;
    box-shadow: var(--shadow-lift);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pt-toast__icon {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px;
}

.pt-toast__body {
    flex: 1;
    min-width: 0;
}

.pt-toast__title {
    font-weight: var(--weight-bold);
    color: var(--pt-ink);
    font-size: var(--text-sm);
}

.pt-toast__msg {
    color: var(--pt-ink-soft);
    font-size: var(--text-sm);
    margin-top: 2px;
}

.pt-toast__close {
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--pt-muted);
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
}

.pt-toast__close:hover {
    color: var(--pt-ink);
}

.pt-toast--success .pt-toast__icon {
    color: var(--pt-success);
}

.pt-toast--info .pt-toast__icon {
    color: var(--petprofessional-deep);
}

.pt-toast--warning .pt-toast__icon {
    color: var(--pt-warning);
}

.pt-toast--danger .pt-toast__icon {
    color: var(--pt-danger);
}

@keyframes pt-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .pt-toast {
        animation: pt-toast-in var(--motion-standard) ease;
    }
}

.p-msg__nudge {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 14px 0;
    padding: 12px 14px;
    border: 1px solid var(--pt-warning);
    border-radius: var(--radius-md);
    background: var(--pt-warning-soft);
    color: var(--pt-ink);
    font-size: 13px;
    line-height: 1.45;
}

.p-msg__nudge.is-on {
    display: flex;
}

.p-msg__nudge i {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--pt-warning);
}

.p-amt {
    color: var(--pt-ink);
    font-weight: 800;
}

.p-num {
    font-variant-numeric: tabular-nums;
}

.p-balance {
    color: var(--pt-ink);
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 800;
    line-height: 1;
    margin: 6px 0 14px;
}

.p-money {
    color: var(--pt-ink);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.p-stack {
    display: grid;
    gap: 16px;
}

.p-break {
    display: grid;
    gap: 11px;
    font-size: 15px;
}

.p-break__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--pt-ink-soft);
}

.p-break__row strong {
    color: var(--pt-ink);
}

.p-break__total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--pt-border);
    padding-top: 11px;
    color: var(--pt-ink);
    font-size: 17px;
    font-weight: 800;
}

.p-main--account {
    margin-left: 0;
}

.p-account-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.p-empty {
    max-width: 480px;
    margin-inline: auto;
    padding: 40px;
    text-align: center;
}

.p-empty__icon {
    width: 32px;
    height: 32px;
    color: var(--pt-muted);
}

.p-empty h3 {
    margin: 12px 0 4px;
}

.p-empty p {
    margin: 0 0 16px;
    color: var(--pt-ink-soft);
}

.p-taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.p-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-pill);
    background: var(--pt-bg);
    color: var(--pt-ink-soft);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
}

.p-tag__remove {
    border: 0;
    background: none;
    color: var(--pt-muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 4px;
}

.p-tag__remove:hover {
    color: var(--pt-ink);
}

.p-filters__sep {
    color: var(--pt-muted);
}

.container {
    width: min(100% - 32px, 1120px);
    margin: 0 auto;
}

.row {
    display: block;
}

.col-lg-10,
.offset-lg-1 {
    max-width: 920px;
    margin-inline: auto;
}

.bg-white {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border);
    box-shadow: var(--shadow-soft);
}

.p-3 {
    padding: 16px;
}

.p-4 {
    padding: clamp(24px, 4vw, 40px);
}

.rounded {
    border-radius: var(--radius-lg);
}

.mb-3 {
    margin-bottom: 16px;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mt-5 {
    margin-top: 32px;
}

.text-muted {
    color: var(--pt-muted);
}

.small,
small {
    font-size: 13px;
}

.list-group {
    display: grid;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.list-group-item {
    padding: 12px 14px;
    border: 1px solid var(--pt-border);
    border-radius: var(--radius-md);
    background: var(--pt-bg-soft);
}

.alert {
    padding: 14px 16px;
    border: 1px solid var(--pt-border);
    border-radius: var(--radius-md);
    background: var(--pt-bg-soft);
}

.alert-warning {
    border-color: var(--pt-warning);
    background: var(--pt-warning-soft);
}

.alert-info {
    border-color: rgba(21, 128, 140, 0.24);
    background: var(--pt-info-soft);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    color: var(--pt-muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--pt-ink);
    font-weight: 700;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin-right: 8px;
    color: var(--pt-muted);
}

.table {
    width: 100%;
    border-collapse: collapse;
    overflow-wrap: anywhere;
}

.table th,
.table td {
    padding: 12px 14px;
    border: 1px solid var(--pt-border);
    text-align: left;
    vertical-align: top;
}

.table-bordered {
    border: 1px solid var(--pt-border);
}

.table th,
.table-light th {
    background: var(--pt-bg-soft);
    color: var(--pt-ink);
}

hr {
    border: 0;
    border-top: 1px solid var(--pt-border);
    margin: 28px 0;
}

.container h1,
.container h2,
.container h3,
.container h4,
.container h5 {
    color: var(--pt-ink);
    line-height: 1.15;
}

.container p,
.container li {
    line-height: 1.65;
}
