/* Style globalne + minimalny zestaw klas formularzy (material look)
   dla stron kont Identity (renderowanych statycznie, poza MudBlazor). */

html, body {
    font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
    margin: 0;
}

h1:focus {
    outline: none;
}

a {
    color: #2E7D32;
}

/* --- karta stron konta --- */
.account-page {
    max-width: 420px;
    margin: 8vh auto 2rem;
    padding: 0 1rem;
}

.account-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.account-brand .logo {
    font-size: 3rem;
    line-height: 1;
}

.account-brand h1 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: .5rem 0 0;
    color: #1B3B22;
}

.account-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);
    padding: 1.5rem;
}

/* --- pola formularzy (material) --- */
.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 1rem;
    padding: 1.35rem .9rem .5rem;
    border: 1px solid #B8C4BA;
    border-radius: 8px;
    background: transparent;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 1px #2E7D32;
}

.form-floating > label {
    position: absolute;
    top: .95rem;
    left: .95rem;
    color: #5f6b61;
    pointer-events: none;
    transition: all .12s ease-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    top: .3rem;
    font-size: .72rem;
    color: #2E7D32;
}

.form-control::placeholder {
    color: transparent;
}

.form-label {
    color: #37423a;
}

.checkbox {
    margin: .5rem 0 1rem;
}

.form-check-input {
    accent-color: #2E7D32;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: .4rem;
    vertical-align: -2px;
}

/* --- przyciski --- */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 500;
    border: none;
    border-radius: 999px;
    padding: .7rem 1.5rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: filter .15s, box-shadow .15s;
}

.btn:focus-visible {
    outline: 2px solid #1B5E20;
    outline-offset: 2px;
}

.btn-primary {
    background: #2E7D32;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-lg {
    font-size: 1.05rem;
    padding: .8rem 1.5rem;
}

.btn-link {
    background: none;
    color: #2E7D32;
    box-shadow: none;
    padding: .4rem .5rem;
}

.w-100 { width: 100%; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: .5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }

.text-danger {
    color: #B3261E;
    font-size: .85rem;
}

.text-secondary { color: #5f6b61; }

.alert {
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .95rem;
}

.alert-danger { background: #FDEDEC; color: #B3261E; }
.alert-success, .alert-info { background: #E7F2E8; color: #1B5E20; }

hr {
    border: none;
    border-top: 1px solid #E2E8E3;
    margin: 1.25rem 0;
}

/* --- walidacja Blazor --- */
.valid.modified:not([type=checkbox]) {
    border-color: #26a531;
}

.invalid {
    border-color: #B3261E;
}

.validation-message {
    color: #B3261E;
    font-size: .85rem;
    margin-top: .25rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #FFF3CD;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

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

/* --- nawigacja zarządzania kontem --- */
.manage-nav {
    list-style: none;
    display: flex;
    gap: .5rem;
    padding: 0;
    margin: 0 0 .5rem;
}

.manage-nav a {
    display: inline-block;
    padding: .35rem .9rem;
    border-radius: 999px;
    text-decoration: none;
    color: #37423a;
    background: #EEF2EE;
}

.manage-nav a.active {
    background: #2E7D32;
    color: #fff;
}

/* --- dolna nawigacja mobilna --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--mud-palette-surface, #fff);
    border-top: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    padding: .25rem 0 calc(.25rem + env(safe-area-inset-bottom));
    z-index: 1300;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--mud-palette-text-secondary, #5f6b61);
    font-size: .68rem;
    padding: .3rem .6rem;
    border-radius: 12px;
    min-width: 56px;
}

.bottom-nav a.active {
    color: var(--mud-palette-primary, #2E7D32);
    background: var(--mud-palette-primary-hover, rgba(46,125,50,.08));
}

.bottom-nav .mud-icon-root {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

@media (min-width: 960px) {
    .bottom-nav { display: none; }
}

/* miejsce na dolną nawigację na mobile */
@media (max-width: 959.98px) {
    .app-content { padding-bottom: 5rem !important; }
}

/* --- nakładka „budzę bazę” na statycznych stronach kont --- */
#db-wake-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 250, 247, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    padding: 1.5rem;
}

.db-wake-box {
    text-align: center;
    max-width: 320px;
}

.db-wake-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1B3B22;
    margin: 1rem 0 .25rem;
}

.db-wake-note {
    font-size: .9rem;
    color: #5f6b61;
    margin: 0;
}

.db-wake-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border: 4px solid #D8E4D9;
    border-top-color: #2E7D32;
    border-radius: 50%;
    animation: db-wake-spin 1s linear infinite;
}

@keyframes db-wake-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .db-wake-spinner { animation-duration: 3s; }
}
