:root {
    --primary-color: #8B7355;
    --primary-light: #A8916D;
    --primary-dark: #6B5B3D;
    --accent-color: #D4B996;
    --text-dark: #2C2C2C;
    --text-light: #5A5A5A;
    --background: #FAF7F2;
    --white: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.95);
    --gradient: linear-gradient(135deg, #8B7355 0%, #A8916D 50%, #D4B996 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Media elements scale within containers */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Make overflowing tables horizontally scrollable on small screens */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive table {
    min-width: 600px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(212, 185, 150, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 115, 85, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(168, 145, 109, 0.05) 0%, transparent 50%);
    background-color: var(--background);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */

nav {
    background: var(--white);
    box-shadow: 0 2px 30px rgba(139, 115, 85, 0.15);
    padding: 1.2rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-logo {
    height: 60px; /* настройте размер под ваш логотип */
    width: auto;
    vertical-align: middle;
    margin-right: 12px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-clip: text;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(139, 115, 85, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.15);
}

.nav-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-logout-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logout-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    transform: translateY(-2px);
}

.user-greeting {
    color: var(--primary-dark);
    font-weight: 600;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content */
main {
    flex: 1;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 40px rgba(139, 115, 85, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid rgba(139, 115, 85, 0.1);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(139, 115, 85, 0.08);
    transition: all 0.3s ease;
}

.card h2 {
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
    text-align: center;
    color: var(--primary-dark);
}

.benefits-list {
    display: flex;
    flex-wrap: wrap; /* перенос на мобильных */
    gap: 20px;
    padding: 0;
    list-style: none;
}

.benefits-list .card {
    flex: 1;
    min-width: 250px; /* минимальная ширина карточки */
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .benefits-list .card {
        flex: 1 1 100%; /* карточки занимают всю ширину */
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
    color: var(--white);
}

/* Auth forms */
.auth-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(139, 115, 85, 0.15);
    border: 1px solid rgba(139, 115, 85, 0.1);
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
    text-align: center;
    color: var(--primary-dark);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 115, 85, 0.2);
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: -0.5rem;
}

.form-errors,
.form-error {
    color: #d93025;
    font-size: 0.9rem;
}

.form-errors {
    background: rgba(217, 48, 37, 0.08);
    border: 1px solid rgba(217, 48, 37, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.form-error {
    margin-top: -0.75rem;
}

.auth-footnote {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.auth-footnote a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.auth-footnote a:hover {
    text-decoration: underline;
}

.search-form {
    margin: 1.5rem 0;
}

.form-group.inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.form-group.inline input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 115, 85, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.favorites-section,
.available-section {
    margin-top: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.services-list {
    list-style: disc;
    margin: 0 0 1rem 1.2rem;
    color: var(--text-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid rgba(139, 115, 85, 0.2);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Decorative Elements */

.helptext {
      font-family: 'Roboto', sans-serif;
      font-size: 0.8rem;
      color: #555;
  }

/* Notifications */
.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    animation: fadeInUp 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-success {
    border-left-color: #27ae60;
    color: #27ae60;
}

.alert-error {
    border-left-color: #e74c3c;
    color: #e74c3c;
}

.alert-info {
    border-left-color: #3498db;
    color: #3498db;
}

.alert-warning {
    border-left-color: #f39c12;
    color: #f39c12;
}

/* Footer Styles */
.site-footer {
    flex-shrink: 0;
    width: 100%;
    background: transparent;
    padding: 4rem 0 2rem;
    margin-top: auto;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--background));
    opacity: 0.5;
    z-index: -1;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    padding: 0 1rem;
}

.footer-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-section h4 {
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a,
.footer-contact a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-light);
}

.footer-contact i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(139, 115, 85, 0.3);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(139, 115, 85, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
}

//* Mobile Navigation Styles */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 0 1rem;
    }

    /* Navigation mobile styles */
    .nav-container {
        position: relative;
        flex-wrap: nowrap;
    }

    .menu-toggle {
        display: flex;
    }

    /* Mobile menu state */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 30px rgba(139, 115, 85, 0.2);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 2rem 2rem;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a,
    .nav-logout-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        margin: 0.25rem 0;
        border-radius: 12px;
        justify-content: flex-start;
        font-size: 1rem;
        border: none;
        background: none;
        text-align: left;
    }

    .user-greeting {
        margin: 1.5rem 0 0.5rem;
        padding: 0 1.5rem;
        font-size: 0.9rem;
        color: var(--text-light);
        justify-content: center;
    }

    /* Overlay for mobile menu */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        z-index: 998;
    }

    .menu-overlay.active {
        display: block;
    }

    /* Brand adjustments */
    .nav-brand {
        font-size: 1.4rem;
        gap: 0.4rem;
    }

    .nav-brand i {
        font-size: 1.2rem;
    }

    /* Main content mobile adjustments */
    main {
        padding: 1.5rem;
        margin: 0 0.5rem 2rem 0.5rem;
        border-radius: 16px;
    }

    .card {
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    /* Benefits list mobile */
    .benefits-list .card {
        min-width: 100%;
        margin: 0.5rem 0;
    }

    /* Form adjustments */
    .auth-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .form-group.inline {
        flex-direction: column;
        gap: 1rem;
    }

    .form-group.inline .btn {
        width: 100%;
        justify-content: center;
    }

    /* Card header mobile */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .card-actions {
        justify-content: stretch;
    }

    .card-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: auto;
    }

    /* Button mobile improvements */
    .btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }

    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 0;
    }

    .social-links {
        justify-content: center;
    }

    /* Hide logo on very small screens */
    .nav-logo {
        height: 50px;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .nav-brand {
        font-size: 1.2rem;
    }

    .nav-brand i {
        font-size: 1rem;
    }

    .nav-logo {
        height: 40px;
    }

    main {
        padding: 1rem;
        border-radius: 12px;
        margin: 0 0.25rem 1rem 0.25rem;
    }

    .card {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }

    /* Improved touch targets */
    .nav-links a,
    .nav-logout-btn {
        padding: 1.2rem 1.5rem;
        min-height: 44px; /* Minimum touch target size */
    }

    .btn {
        min-height: 44px;
        padding: 1rem 1.5rem;
    }

    /* Better spacing for mobile */
    .services-list {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }

    /* Adjust font sizes for readability */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    h1, h2, h3 {
        line-height: 1.3;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .nav-links a:hover,
    .nav-logout-btn:hover,
    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    /* Increase tap targets */
    .nav-links a,
    .nav-logout-btn,
    .btn {
        min-height: 44px;
    }

    /* Better focus states for touch */
    .nav-links a:active,
    .nav-logout-btn:active,
    .btn:active {
        transform: scale(0.98);
        background: rgba(139, 115, 85, 0.15);
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-links {
        padding-top: 60px;
        padding-bottom: 1rem;
    }

    .nav-links a,
    .nav-logout-btn {
        padding: 0.8rem 1.5rem;
        min-height: 40px;
    }

    main {
        padding: 1rem;
    }
}