/* Zmienne CSS dla łatwego zarządzania kolorami i stylem */
:root {
    --primary-color: #5527d8; /* Głęboki fiolet z inspiracji */
    --primary-hover: #401db3;
    --bg-color: #f8f9fc;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

/* Podstawowe style strony */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- WSPÓLNE KLASY (do użycia w całej aplikacji) --- */

/* Kontenery */
.wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Typografia */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-main);
}

.page-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.page-footnote {
    text-align: justify;
    text-justify: inter-character; /* Rozkłada wolne miejsce na litery, nie tylko słowa */
    text-align-last: center;

    width: 100%;       /* Wypełnia całą szerokość */
    margin: 0;
    padding: 0.5em 0 2em 0;  /* Brak paddingu po bokach */

    color: var(--text-muted);
    font-size: 0.65rem;
}

/* Formularze */
.form-row {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Automatyczne stylowanie inputów Django */
.form-control, input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
    background-color: #fdfdfd;
}

.form-control:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(85, 39, 216, 0.15);
    background-color: #fff;
}

/* Błędy i podpowiedzi */
.form-help {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* Domyślna lista błędów Django */
ul.errorlist {
    color: #ef4444;
    font-size: 0.85rem;
    margin: 0.4rem 0 0 0;
    padding-left: 0;
    list-style-type: none;
}

.alert-error {
    padding: 1rem;
    background-color: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
}

/* Przyciski */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 39, 216, 0.2);
}

/* Linki */
.links-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Specyficzne dla Dashboardu */
.dashboard-info {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.dashboard-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.dashboard-info strong {
    color: var(--text-main);
}

/* Kontener na wiadomości systemowe */
.messages-container {
    margin-bottom: 3rem;
    width: 100%;
}

/* Podstawowy styl powiadomienia */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

/* Kolory zależne od typu wiadomości (Django tags) */
.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error, .alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

/* Subtelna animacja pojawiania się */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 18px 24px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.dashboard-topbar__left,
.dashboard-topbar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-customer {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.dashboard-user-email {
    font-size: 0.95rem;
    color: #4b5563;
}

.dashboard-logout-form {
    margin: 0;
}

.dashboard-logout-button {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-heading h1 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

.dashboard-heading--with-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-back-link {
    display: inline-block;
    margin-bottom: 10px;
    text-decoration: none;
    font-size: 0.95rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.dashboard-card {
    display: block;
    min-height: 170px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.dashboard-card--static:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
}

.dashboard-card__body {
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-card__title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
}

.dashboard-card__description {
    margin: 12px 0 0;
    color: #4b5563;
    line-height: 1.5;
}

.dashboard-empty-state {
    padding: 24px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
}