:root {
    --accent: #0f766e;
}

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.navbar-brand {
    color: var(--accent);
}

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #0b5f58;
    --bs-btn-hover-border-color: #0b5f58;
    --bs-btn-active-bg: #0b5f58;
    --bs-btn-active-border-color: #0b5f58;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}

a { color: var(--accent); }

.validation-message { color: #dc3545; }
.form-control.invalid { border-color: #dc3545; }

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- Zone ---- */
.zone-row {
    display: grid;
    grid-template-columns: 2rem 1fr 6.5rem 9rem;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.zone-name { font-weight: 600; }

.zone-track {
    background: rgba(127, 127, 127, 0.15);
    border-radius: 4px;
    height: 0.9rem;
    overflow: hidden;
}

.zone-fill {
    height: 100%;
    border-radius: 4px;
}

.zone-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.zone-dot {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
}

@media (max-width: 575.98px) {
    .zone-row { grid-template-columns: 2rem 1fr 6.5rem; }
    .zone-range { display: none; }
}

/* ---- Stato di forma ---- */
.tsb-gauge {
    display: block;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.form-advice {
    border-left: 4px solid #42a5f5;
    background: rgba(127, 127, 127, 0.08);
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
}

/* ---- Chat con il coach ---- */
.chat-box {
    height: 55vh;
    min-height: 18rem;
    overflow-y: auto;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
}

.chat-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.9rem;
}

.chat-user { align-items: flex-end; }
.chat-model { align-items: flex-start; }

.chat-bubble {
    max-width: 88%;
    padding: 0.6rem 0.9rem;
    border-radius: 0.75rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-user .chat-bubble {
    background: var(--accent);
    color: #fff;
}

.chat-model .chat-bubble {
    background: rgba(127, 127, 127, 0.12);
}

.chat-time {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.15rem;
}

/* ---- Scheda workout nella chat ---- */
.workout-card {
    max-width: 88%;
    margin-bottom: 0.5rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-left: 4px solid var(--accent);
    border-radius: 0.5rem;
    background: rgba(127, 127, 127, 0.06);
}

.workout-text {
    margin: 0 0 0.5rem 0;
    padding: 0.6rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    background: rgba(127, 127, 127, 0.12);
    border-radius: 0.35rem;
}

.navbar .nav-link {
    color: #334155;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .navbar .nav-link:hover {
        background-color: rgba(15, 23, 42, 0.05);
        color: #0f172a;
    }

    .navbar .nav-link.active {
        background-color: rgba(13, 148, 136, 0.12);
        color: #0f766e;
        font-weight: 600;
    }

.navbar .stamina-admin-link {
    color: #7c2d12;
}

    .navbar .stamina-admin-link.active {
        background-color: rgba(194, 65, 12, 0.12);
        color: #9a3412;
    }

.navbar-brand .stamina-brand-img {
    height: 38px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    vertical-align: middle;
}

.navbar .nav-link {
    color: #334155;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .navbar .nav-link:hover {
        background-color: rgba(15, 23, 42, 0.05);
        color: #0f172a;
    }

    .navbar .nav-link.active {
        background-color: rgba(13, 148, 136, 0.12);
        color: #0f766e;
        font-weight: 600;
    }

.navbar .stamina-admin-link {
    color: #7c2d12;
}

    .navbar .stamina-admin-link.active {
        background-color: rgba(194, 65, 12, 0.12);
        color: #9a3412;
    }


.stamina-auth-page {
    background: linear-gradient(145deg, #f0fdfa 0%, #f8fafc 48%, #eff6ff 100%);
}

.stamina-auth-card {
    border-radius: 1rem;
    background-color: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08) !important;
}

.stamina-auth-logo {
    max-height: 175px;
    width: auto;
    mix-blend-mode: multiply;
}

.stamina-brand-img,
.stamina-auth-logo {
    mix-blend-mode: multiply;
}