:root {
    --navbar-height: 64px;
}

body {
    background-color: #f4f6f8;
    color: #0f172a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.theme-dark {
    background-color: #0b1220;
    color: #e8ecff;
}

.auth-page {
    min-height: calc(100vh - var(--navbar-height, 64px));
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page .container {
    width: 100%;
}

.navbar-brand {
    font-weight: 600;
}

.card-shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-link {
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
    height: 100%;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.lang-flag {
    font-size: 0.8rem;
}

.flash-container {
    margin-bottom: 1.5rem;
}

.dashboard-hero {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #fff;
    border-radius: 1rem;
    padding: 2rem;
}

.dashboard-hero-warning {
    background: linear-gradient(135deg, #fd7e14, #ffc107);
}

.dashboard-hero-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

.dashboard-hero .progress {
    height: 0.8rem;
    background-color: rgba(255, 255, 255, 0.3);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.kpi-card {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    text-align: center;
}

.kpi-card.expiry-card {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.kpi-card .kpi-meta {
    font-size: 0.85rem;
    opacity: 0.8;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.floating-add-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1030;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.4);
}

.dashboard-actions-section {
    margin-top: 2rem;
}

.saved-places-card textarea {
    min-height: 38px;
}

.saved-places-list .list-group-item {
    border-left: 4px solid transparent;
}

.saved-place-item {
    border-left-color: rgba(13, 110, 253, 0.35);
}

.saved-place-name {
    font-weight: 600;
}

.saved-place-lines {
    font-size: 0.85rem;
}

.saved-place-notes {
    line-height: 1.4;
}

.renew-period-card {
    border-left: 4px solid #fd7e14;
    background-color: #fff8e8;
}

.renew-period-hint {
    line-height: 1.4;
}

.invite-card {
    border-left: 4px solid #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(102, 16, 242, 0.08));
}

.invite-card-btn {
    min-width: 220px;
    font-weight: 600;
}

.action-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.action-option {
    flex: 1 1 180px;
    border: 1px solid rgba(13, 110, 253, 0.25);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: #0d6efd;
    font-weight: 600;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.action-option:hover,
.action-option:focus-visible {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0a58ca;
}

.action-option .option-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.trip-row {
    border-left: 4px solid transparent;
}

.trip-row.in-period {
    border-left-color: #198754;
}

.trip-row.out-period {
    border-left-color: #dc3545;
}

.trips-list .list-group-item {
    border-radius: 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.trips-list .list-group-item:last-child {
    margin-bottom: 0;
}

.trip-actions form {
    margin-bottom: 0;
}

.trip-entry .badge {
    min-width: 130px;
    text-align: center;
}

.invite-page .card {
    border-radius: 1.25rem;
}

.invite-qr-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 1rem;
}

.invite-qr {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.invite-link {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: #f1f3f5;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.95rem;
}

.places-page .card {
    border-radius: 1.25rem;
}

.place-actions form {
    display: inline;
}

.collapse-toggle .label-collapsed {
    display: none;
}

.collapse-toggle.collapsed .label-expanded {
    display: none;
}

.collapse-toggle.collapsed .label-collapsed {
    display: inline;
}

@media (max-width: 576px) {
    .dashboard-hero {
        padding: 1.5rem;
    }

    .invite-card-btn {
        width: 100%;
    }

    .card-shadow {
        border-radius: 1rem;
    }

    .renew-period-card .text-md-end {
        text-align: left !important;
    }

    .place-actions {
        width: 100%;
    }

    .auth-page {
        align-items: flex-start;
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

body.theme-dark .navbar {
    background-color: #111a2e;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .navbar-brand,
body.theme-dark .nav-link {
    color: #e8ecff !important;
}

body.theme-dark .nav-link.text-danger {
    color: #ff6b6b !important;
}

body.theme-dark .card,
body.theme-dark .card-shadow,
body.theme-dark .list-group-item,
body.theme-dark .dropdown-menu {
    background-color: #161f35;
    color: #f8fbff;
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .card-shadow {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

body.theme-dark .text-muted,
body.theme-dark .form-text {
    color: rgba(232, 236, 255, 0.75) !important;
}

body.theme-dark .list-group-item {
    border-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .trips-list .list-group-item {
    background-color: #161f35;
}

body.theme-dark .saved-place-item {
    border-left-color: rgba(13, 110, 253, 0.55);
}

body.theme-dark .action-option {
    background-color: #111a2e;
    border-color: rgba(255, 255, 255, 0.15);
    color: #9ec1ff;
}

body.theme-dark .action-option:hover,
body.theme-dark .action-option:focus-visible {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark textarea,
body.theme-dark .form-check-input {
    background-color: #0f172a;
    color: #f5f7ff;
    border-color: rgba(255, 255, 255, 0.2);
}

body.theme-dark .form-control::placeholder,
body.theme-dark .form-select option {
    color: rgba(248, 249, 255, 0.7);
}

body.theme-dark .flash-container .alert {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    border: none;
}

body.theme-dark .dropdown-menu {
    background-color: #111a2e;
}

body.theme-dark .dropdown-item {
    color: #f1f5ff;
}

body.theme-dark .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .navbar-light .navbar-toggler,
body.theme-dark .navbar-light .navbar-toggler-icon {
    border-color: rgba(255, 255, 255, 0.35);
    filter: invert(1);
}

body.theme-dark .renew-period-card {
    background-color: rgba(253, 126, 20, 0.12);
    border-left-color: #fd7e14;
}

body.theme-dark .invite-card {
    border-left-color: #4c7dff;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.35), rgba(102, 16, 242, 0.35));
}

body.theme-dark .btn-outline-secondary,
body.theme-dark .btn-outline-primary {
    color: #e1e6ff;
    border-color: rgba(255, 255, 255, 0.35);
}

body.theme-dark .btn-outline-secondary:hover,
body.theme-dark .btn-outline-primary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

body.theme-dark .alert-info {
    background-color: rgba(13, 202, 240, 0.15);
    color: #e8fcff;
    border: none;
}

body.theme-dark .action-option,
body.theme-dark .card,
body.theme-dark .navbar,
body.theme-dark .dropdown-menu,
body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .list-group-item {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.landing-hero {
    margin-top: -25px;
    min-height: calc(100vh - 56px);
    background-image: linear-gradient(135deg, rgba(2, 0, 36, 0.35), rgba(13, 110, 253, 0.65)), url('/assets/hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #fff;
}

.landing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.35);
}

.landing-content {
    position: relative;
    text-align: center;
    max-width: 640px;
    z-index: 1;
}

.landing-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.landing-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.landing-actions .btn-link {
    text-decoration: none;
    font-weight: 600;
}
