/* Основные переменные — светлая минималистичная палитра в стиле Apple */
:root {
    --primary: #000000; /* Black */
    --primary-dark: #000000;
    --primary-light: #f5f5f5;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --gray-25: #FCFCFD;
    --gray-50: #F8F8F8;
    --gray-100: #F2F2F2;
    --gray-200: #E6E6E6;
    --gray-300: #DADADA;
    --gray-400: #BFBFBF;
    --gray-500: #8F8F8F;
    --gray-600: #6B6B6B;
    --gray-700: #444444;
    --gray-800: #2B2B2B;
    --gray-900: #111111;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: white;
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Типографика */
h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

h1 { font-size: 44px; font-weight: 700; }
h2 { font-size: 28px; font-weight: 600; }
h3 { font-size: 22px; font-weight: 600; }
p  { color: var(--gray-700); font-size: 16px; }

/* Макеты */
.container {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.section {
    padding: 72px 0;
}

/* Приветственная страница */
.welcome-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
}

.welcome-content {
    max-width: 800px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.logo {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.logo img {
    width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease, color 200ms ease;
    will-change: transform;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: white;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
}

/* Премиальный грид карточек */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.profile-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.profile-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.profile-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.profile-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 16px 16px 8px 16px;
}

.profile-card p {
    margin: 0 16px 16px 16px;
    color: var(--gray-600);
}

.profile-card a {
    margin: 0 16px 20px 16px;
    display: inline-flex;
}

/* Особенности */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-item {
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
}

.feature-item i {
    font-size: 2rem;
    color: #000000;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Профиль */
.profile-container {
    min-height: 100vh;
    background: var(--page-bg, white);
}

/* Шапка профиля */
.profile-header {
    position: relative;
    padding: 2rem 1.5rem;
    color: white;
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3), transparent);
}

/* Варианты шапки: с фоном и без фона */
.profile-header.has-bg .profile-main-info { color: white; }
.profile-header.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.28) 45%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 0;
}
.profile-header.no-bg {
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3), transparent);
}
.profile-header.has-bg .profile-name,
.profile-header.has-bg .profile-position,
.profile-header.has-bg .profile-company {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.profile-header.no-bg .profile-name,
.profile-header.no-bg .profile-position,
.profile-header.no-bg .profile-company {
    color: var(--gray-900);
}
.profile-header.no-bg .action-btn {
    background: rgba(17, 17, 17, 0.06);
    border: 1px solid rgba(17,17,17,0.12);
    color: var(--gray-900);
    backdrop-filter: saturate(180%) blur(12px);
}
.profile-header.no-bg .action-btn:hover {
    background: rgba(17, 17, 17, 0.1);
}
.profile-header.no-bg .profile-name,
.profile-header.no-bg .profile-position,
.profile-header.no-bg .profile-company {
    color: var(--gray-900);
    text-shadow: none;
}

/* Красивый тулбар действий на десктопе */
.header-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: saturate(180%) blur(16px);
    z-index: 10;
    border: 1px solid rgba(17, 17, 17, 0.12);

}
.header-actions-left,
.header-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-header.no-bg .header-actions {
    border: 1px solid rgba(17, 17, 17, 0.12);
}

.profile-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
}

.profile-main-info {
    position: relative;
    z-index: 1;
}

/* Аватар профиля */
.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: 32px;
    margin: 0 auto 1.5rem;
    border: 6px solid rgba(255,255,255,0.75);
    background: white;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-overlay i {
    color: white;
    font-size: 2rem;
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-position {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 0.25rem;
}

.profile-company {
    font-size: 1rem;
    opacity: 0.9;
}

/* Иконки на светлом фоне должны быть видны */
.contact-card i,
.action-btn i,
.social-card i {
    filter: none;
}
.profile-header.no-bg .action-btn i { color: var(--gray-900); }
.contact-card i { color: #000000; }

/* Основной контент */
.profile-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.profile-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line-color, var(--gray-200));
    box-shadow: var(--shadow-sm);
}

.profile-bio {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.6;
    text-align: center;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Контакты */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

.contact-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-900);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    min-width: 0; /* allow shrinking inside grid on small screens */
    overflow: hidden; /* avoid horizontal scroll from long content */
}

.contact-card:hover {
    transform: translateY(-2px);
    background: var(--gray-100);
}

.contact-card i {
    font-size: 1.5rem;
    color: #000000;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    min-width: 0; /* let text wrap instead of stretching container */
    flex: 1 1 auto;
}

.contact-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.contact-value {
    font-size: 1rem;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Социальные сети */
.social-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow: visible;
}

/* Обеспечить, чтобы карточки контактов не выходили за рамки контейнера */
.social-card {
    max-width: 100%;
}
.social-card-link {
    min-width: 0;
}
.social-card span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* На узких экранах уменьшаем внутренние отступы, чтобы избежать переполнения */
@media (max-width: 400px) {
    .social-card {
        padding: 0.875rem 1rem;
    }
    .social-card-link {
        padding-right: 56px;
    }
}

.social-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
    min-height: 60px;
    position: relative;
    overflow: visible; /* не обрезать выпадающее меню */
    z-index: 1; /* базовый слой над соседями */
    cursor: default;
}

.social-card:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.social-card:active { cursor: default; }

.social-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.social-card i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Иконка не должна обрезаться на мобильных */
.social-card-link i { flex-shrink: 0; overflow: visible; }

.social-card span {
    font-size: 1rem;
    font-weight: 600;
}

.social-card-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    flex: 1;
    padding-right: 72px; /* reserve space for right drag handle + menu */
}

.social-card-link:hover {
    color: white;
    text-decoration: none;
}

.drag-handle {
    position: absolute;
    right: 44px; /* invisible drag zone left of the menu button */
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    cursor: default; /* do not show grab cursor */
    padding: 4px;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.drag-handle i { display: none; }
.card-menu {
    position: absolute;
    top: 50%;
    right: 16px; /* flush to the right edge */
    transform: translateY(-50%);
    z-index: 5;
}

.card-menu-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 999px;
    transition: transform 0.2s ease;
    touch-action: none; /* отключаем нативный жест прокрутки при удержании на iOS */
}

.card-menu-btn i { display: inline-block; font-size: 18px; line-height: 1; }

.card-menu-btn::before { content: none; }

.card-menu-btn:hover { transform: translateY(-1px); }

.card-dropdown {
    position: absolute;
    top: 38px;
    right: 0;
    display: none;
    min-width: 180px;
    background: white;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100000; /* поверх соседних карточек и контейнеров */
}

.card-dropdown.show { display: block; }

/* Всплытие вверх, если места снизу мало */
.card-dropdown.flip-up {
    top: auto;
    bottom: 38px;
}

/* Портал: когда меню отцеплено и закреплено к body (исправление iOS Safari) */
.card-dropdown.portal {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    transform: translate3d(0,0,0); /* триггер композитинга для плавности на iOS */
}

.social-card.menu-open {
    position: relative;
    z-index: 10000; /* поднять карточку над соседями */
    overflow: visible;
    transform: none; /* avoid new stacking context from hover transform */
}

.card-action {
    width: 100%;
    background: white;
    border: none;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.card-action:hover {
    background: var(--gray-100);
}

.card-action.danger { color: #DC2626; }


.drag-handle:hover { background: transparent; }

.social-card:hover .drag-handle {
    color: rgba(255, 255, 255, 0.8);
}

.social-card:active .drag-handle { cursor: default; }

.social-card.telegram { background: #0088cc; }
.social-card.whatsapp { background: #25D366; }
.social-card.instagram { 
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.social-card.facebook { background: #1877F2; }
.social-card.linkedin { background: #0A66C2; }
/* Variants to style contacts like social buttons */
.social-card.phone { background: #111111; }
.social-card.email { background: #444444; }
.social-card.website { background: #6B6B6B; }

/* QR код и действия */
/* Неактивные (скрытые) виджеты для владельца */
.social-card.inactive {
    background: #D9D9D9 !important;
    color: #ffffff;
    filter: none;
}

.social-card.inactive .social-card-link { pointer-events: none; }
.social-card.inactive .social-card-link i { color: #ffffff; }
.social-card.inactive .social-card-link span { color: #ffffff; }
.social-card.inactive .drag-handle { color: rgba(255,255,255,0.7); }
.actions-section {
    text-align: center;
}

.qr-container {
    margin-bottom: 1.5rem;
}

.qr-code {
    width: 200px;
    height: 200px;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Кнопки в шапке */
.header-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--gray-200);
    backdrop-filter: saturate(180%) blur(16px);
    z-index: 10;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background-color: white !important;
    border: 3px solid var(--gray-200) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    backdrop-filter: saturate(180%) blur(20px);
}

/* Monochrome toolbar buttons */
.header-actions .action-btn {
    background: transparent;
    border: none;
    color: var(--gray-900);
    backdrop-filter: none;
}
.header-actions .action-btn i { color: var(--gray-900); }
.header-actions .action-btn:hover {
    background: rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.25rem;
}

.logout-form {
    margin: 0;
}

.logout-form.desktop-only {
    margin: 0;
    display: inline-flex;
}

.logout-form.desktop-only .action-btn {
    margin: 0;
}

/* Десктопные кнопки */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .profile-header {
        min-height: 280px;
        padding: 1.5rem 1rem;
    }
    
    .profile-main-info {
        padding: 2rem 1rem 1.5rem;
        margin: -1.5rem -1rem;
    }

    .profile-avatar {
        width: 156px;
        height: 156px;
        margin-bottom: 1rem;
        border-width: 3px;
    }

    .profile-name {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        line-height: 1.1;
    }

    .profile-position {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        line-height: 1.2;
    }

    .profile-company {
        font-size: 0.8rem;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        opacity: 0.9;
        line-height: 1.2;
    }

    .profile-content {
        padding: 1.5rem 1rem;
        margin-top: -2rem;
        position: relative;
        z-index: 2;
    }

    .profile-section {
        padding: 1.5rem;
        margin-bottom: 1.25rem;
        border-radius: var(--radius-xl);
    }

    .contact-grid,
    .social-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .contact-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }

    .contact-card i {
        font-size: 1.75rem;
        width: 32px;
    }

    .contact-label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .contact-value {
        font-size: 1.125rem;
    }

    .social-card {
        padding: 1.25rem;
        font-size: 1.125rem;
    }

    .social-card i {
        font-size: 1.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        right: 0;
        padding: 0 1rem;
        background: none !important;
        border: none !important;
        backdrop-filter: none;

    }

    .header-actions-left {
        display: flex;
        gap: 0.5rem;
    }

    .header-actions-right {
        display: flex;
        gap: 0.5rem;
    }

    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .profile-header {
        min-height: 260px;
    }

    .profile-avatar {
        width: 130px;
        height: 130px;
        margin-bottom: 0.75rem;
    }

    .profile-name {
        font-size: 1.15rem;
        margin-bottom: 0.375rem;
    }

    .profile-position {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .profile-company {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .contact-card,
    .social-card {
        padding: 1rem;
    }

    .avatar-modal-image {
        max-width: 95%;
        max-height: 95vh;
    }

    .close-avatar-modal {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .welcome-content h1 {
        font-size: 2rem;
    }

    .welcome-actions {
        flex-direction: column;
    }

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

    .profile-header {
        height: 220px;
    }

    .profile-avatar {
        width: 140px;
        height: 140px;
    }

    .profile-content {
        padding: 1.5rem;
        margin-top: -40px;
    }

    .profile-header {
        height: 200px;
        padding: 1rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .contact-item,
    .social-item {
        padding: 0.75rem 1rem;
    }
} 

/* Формы аутентификации */
.auth-container {
    max-width: 420px;
    margin: 96px auto;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.auth-container h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background-color: white;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.submit-button {
    background: var(--primary);
    color: white;
    padding: 0.9rem 1.6rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links a {
    color: #000000;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

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

/* Сообщения и ошибки */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
}

.alert-success {
    background-color: #DCFCE7;
    border: 1px solid #86EFAC;
    color: #166534;
}

.error {
    color: #DC2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.help-text {
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Адаптивность для форм */
@media (max-width: 768px) {
    .auth-container {
        padding: 1.5rem;
    }

    .auth-container h1 {
        font-size: 1.5rem;
    }

    .form-control {
        font-size: 16px; /* Предотвращает масштабирование на iOS */
    }
}

/* Добавьте стили для полей формы Django */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background-color: white;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

/* Стили для кнопок формы */
button[type="submit"] {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 0.9rem 1.6rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    position: relative;
    max-width: 90%;
    width: 420px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--gray-700);
}

/* QR код */
.qr-container {
    text-align: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }

    .qr-code {
        width: 180px;
        height: 180px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
} 

/* Стили для страницы редактирования профиля */
.edit-profile-container {
    min-height: 100vh;
    background: white;
    padding-bottom: 2rem;
}

.edit-header {
    background: #000000;
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(16px);
}

.edit-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.edit-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.form-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.form-section .section-title {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

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

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #000000;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.help-text {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}

.save-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Адаптивность для формы редактирования */
@media (max-width: 768px) {
    .edit-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .form-section {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .save-button {
        width: 100%;
        justify-content: center;
    }
} 

/* Адаптивность для маленьких экранов */
@media (max-width: 480px) {
    .logo {
        max-width: 220px;
    }
    
    .welcome-content {
        padding: 0 1rem;
    }
} 

/* Модальное окно для фото профиля */
.avatar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.avatar-modal-image {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.close-avatar-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-avatar-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    z-index: 1000;
    padding: 2rem 1rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
}

.mobile-menu.show {
    right: 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--gray-800);
    text-decoration: none;
    font-size: 1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-menu-item:hover {
    background-color: var(--gray-100);
}

.mobile-menu-item i {
    width: 20px;
    text-align: center;
    color: #000000;
}

.mobile-menu-form {
    margin: 0;
    padding: 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu-overlay.show {
    display: block;
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;

    }
}

/* Стили для виджетов */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.widget-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.widget-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
}

.widget-icon i {
    font-size: 1.5rem;
}

.widget-content {
    flex: 1;
    min-width: 0;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.widget-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.widget-link:hover {
    opacity: 0.8;
}

.widget-text,
.widget-contact {
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-word;
}

/* Кнопка добавления виджетов */
.add-widget-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.add-widget-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.add-widget-btn i {
    font-size: 1.5rem;
}

/* Стили для страниц управления виджетами */
.widgets-container,
.widget-form-container,
.delete-container {
    min-height: 100vh;
    background: white;
    padding: 2rem 1.5rem;
}

.widgets-header,
.widget-form-header,
.delete-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.widgets-header h1,
.widget-form-header h1,
.delete-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--gray-200);
    transform: translateX(-2px);
}

.widgets-actions {
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-50);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Виджеты в списке */
.widget-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.widget-item:hover {
    box-shadow: var(--shadow-md);
}

.widget-item.inactive {
    opacity: 0.6;
}

.widget-preview {
    padding: 1.5rem;
}

.widget-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.widget-type {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.widget-preview-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.empty-state p {
    margin-bottom: 2rem;
    color: var(--gray-600);
}

/* Форма виджета */
.widget-form {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Предварительный просмотр */
.widget-preview-section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* Ограничение ширины формы создания по шаблону и секции превью */
#templateForm {
    max-width: 752px;
    margin-left: auto;
    margin-right: auto;
}

.widget-preview-section {
    max-width: 752px;
    margin-left: auto;
    margin-right: auto;
}

/* Селектор цветов как в примере */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 2px solid var(--gray-200);
    background: var(--swatch);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.color-option:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.color-option.active { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

.color-option.custom {
    background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    position: relative;
    overflow: hidden;
}

.color-option.custom input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.widget-preview-section h3 {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.preview-widget {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

/* Удаление виджета */
.delete-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.warning-icon {
    font-size: 4rem;
    color: var(--warning);
    margin-bottom: 1rem;
}

.delete-content h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.warning-text {
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.delete-form {
    margin-top: 2rem;
}

/* Адаптивность для виджетов */
@media (max-width: 768px) {
    .widgets-container,
    .widget-form-container,
    .delete-container {
        padding: 1rem;
    }

    .widgets-header,
    .widget-form-header,
    .delete-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .widgets-header h1,
    .widget-form-header h1,
    .delete-header h1 {
        font-size: 1.5rem;
    }

    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .widget-card {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

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

    .add-widget-btn {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }

    .add-widget-btn i {
        font-size: 1.25rem;
    }
}

/* Стили для страницы шаблонов виджетов */
.templates-container {
    min-height: 100vh;
    background: white;
    padding: 2rem 1.5rem;
}

.templates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.templates-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* Вкладки */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
}

.tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: white;
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

.tab-button:hover:not(.active) {
    color: var(--gray-800);
}

.tab-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab-button.active .tab-count {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Сетка шаблонов */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.template-card {
    position: relative;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Убираем подчёркивание ссылок-карточек на странице шаблонов */
a.template-card:link,
a.template-card:visited,
a.template-card:hover,
a.template-card:active {
    text-decoration: none;
    color: inherit;
}

.template-title,
.template-description {
    text-decoration: none;
}

.template-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.template-preview {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.template-preview i {
    font-size: 1.5rem;
    color: white;
}

.template-card:hover .template-preview {
    transform: scale(1.1);
}

.template-info { margin: 0; }

.template-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.template-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.4;
    margin: 0;
}

.template-add-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.template-card:hover .template-add-btn {
    opacity: 1;
}

.template-add-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Модальное окно для шаблона */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    position: relative;
    max-width: 90%;
    width: 500px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

#templateForm {
    padding: 2rem;
}

#templateForm .form-group {
    margin-bottom: 1.5rem;
}

#templateForm .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

#templateForm .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background-color: white;
    transition: all 0.2s ease;
}

#templateForm .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

#templateForm .help-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

#templateForm .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Адаптивность для шаблонов */
@media (max-width: 768px) {
    .templates-container {
        padding: 1rem;
    }

    .templates-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .templates-header h1 {
        font-size: 1.5rem;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .template-card {
        padding: 1rem;
    }

    .template-preview {
        width: 50px;
        height: 50px;
    }

    .template-preview i {
        font-size: 1.25rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header,
    #templateForm {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

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