/* ============================================
   style.css - Полные стили для ВиджетСервис
   Версия 3.0
   ============================================ */

/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f6fa;
    color: #1a1a2e;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #fc3f1d;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #e63515;
}

/* ===== ХЕДЕР ===== */
header {
    background: #1a1a2e;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo a {
    text-decoration: none;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fc3f1d, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
    transition: background 0.3s;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fc3f1d;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

/* Кнопки входа/выхода */
.btn-login {
    padding: 8px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    background: #fc3f1d;
    color: white;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login:hover {
    background: #e63515;
    transform: scale(1.05);
    color: white;
}

.btn-logout {
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-back-header {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-back-header:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== ГЛАВНАЯ СТРАНИЦА ===== */
.hero {
    text-align: center;
    padding: 80px 20px;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
}

.hero h2 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #1a1a2e;
    line-height: 1.2;
}

.hero p {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature {
    background: white;
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.feature h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.feature p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.btn-login-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: #fc3f1d;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-login-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(252, 63, 29, 0.4);
    color: white;
}

.btn-login-large svg {
    flex-shrink: 0;
}

/* ===== ЛИЧНЫЙ КАБИНЕТ ===== */
.cabinet-container {
    display: flex;
    gap: 30px;
    padding: 30px 0;
    min-height: calc(100vh - 80px);
}

/* Боковая панель */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 20px;
    color: #1a1a2e;
    font-size: 18px;
    font-weight: 700;
}

.widget-catalog {
    list-style: none;
    padding: 0;
}

.widget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 4px;
    position: relative;
}

.widget-item:hover:not(.disabled) {
    background: #f5f6fa;
}

.widget-item.active {
    background: rgba(252, 63, 29, 0.08);
    border-left: 3px solid #fc3f1d;
}

.widget-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-item.disabled:hover {
    background: none;
}

.widget-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.widget-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.widget-badge {
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-badge.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.widget-badge.soon {
    background: #fff3e0;
    color: #e65100;
}

.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

.sidebar-actions h4 {
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.btn-add-widget {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s;
    color: #666;
}

.btn-add-widget:hover {
    border-color: #fc3f1d;
    color: #fc3f1d;
    background: rgba(252, 63, 29, 0.05);
}

.sidebar-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.stat-label {
    color: #999;
}

.stat-value {
    color: #1a1a2e;
    font-weight: 600;
}

.btn-demo-sidebar {
    display: block;
    margin-top: 12px;
    padding: 10px;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-demo-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Основной контент */
.content {
    flex: 1;
    min-width: 0;
}

.content h2 {
    font-size: 24px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

/* Уведомления */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-dismissible {
    padding-right: 40px;
}

.alert-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0 4px;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок списка виджетов */
.widgets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.widgets-header h2 {
    margin: 0;
}

.widgets-count {
    background: #f0f0f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Сетка виджетов */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* Карточка виджета */
.widget-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s ease;
}

.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.widget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.widget-title h3 {
    font-size: 17px;
    color: #1a1a2e;
    margin: 0;
    word-break: break-word;
}

.widget-icon-small {
    font-size: 22px;
    flex-shrink: 0;
}

.widget-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.widget-actions a {
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s;
    opacity: 0.6;
    line-height: 1;
}

.widget-actions a:hover {
    opacity: 1;
    background: #f0f0f0;
}

.widget-actions .btn-edit:hover {
    background: #e3f2fd;
    transform: rotate(30deg);
}

.widget-actions .btn-delete:hover {
    background: #ffebee;
    color: #e74c3c;
    transform: scale(1.1);
}

.widget-card-preview {
    margin: 12px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.widget-card-preview .scratch-widget-wrapper {
    max-width: 500px;
    width: 100%;
}

.widget-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.widget-type-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.widget-created {
    color: #999;
    font-size: 12px;
}

.widget-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.btn-edit-widget {
    display: block;
    text-align: center;
    padding: 8px;
    background: #fc3f1d;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-edit-widget:hover {
    background: #e63515;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(252, 63, 29, 0.3);
    color: white;
}

/* ============================================
   СКРЕТЧ-ВИДЖЕТ - НА ВСЮ ШИРИНУ
   ============================================ */
.scratch-widget-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.scratch-widget-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
    min-height: 300px;
    width: 100%;
}

/* Левая часть - скретч-плёнка поверх промокода */
.scratch-left {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 300px;
}

.scratch-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    overflow: hidden;
}

/* ПРОМОКОД - всегда виден, но перекрыт плёнкой */
.promo-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    z-index: 0;
    padding: 20px;
}

.promo-code-value {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: 12px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 10px;
}

/* ПЛЁНКА - поверх промокода, стирается */
.scratch-container .scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    touch-action: none;
    z-index: 2;
    display: block;

}

/* Правая часть - подсказка */
.scratch-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 300px;
}

.hint-content {
    text-align: center;
    max-width: 400px;
    padding: 10px;
}

.hint-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.hint-text {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.5;
    color: #1a1a2e;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .scratch-widget-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: auto;
    }
    
    .scratch-left {
        min-height: 250px;
    }
    
    .scratch-container {
        min-height: 250px;
    }
    
    .promo-code-value {
        font-size: 42px;
        letter-spacing: 8px;
    }
    
    .scratch-right {
        min-height: 150px;
        padding: 20px;
    }
    
    .hint-text {
        font-size: 18px;
    }
    
    .hint-icon {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .scratch-left {
        min-height: 200px;
    }
    
    .scratch-container {
        min-height: 200px;
    }
    
    .promo-code-value {
        font-size: 28px;
        letter-spacing: 4px;
    }
    
    .hint-text {
        font-size: 16px;
    }
}

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.empty-state p {
    color: #999;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .btn-primary {
    display: inline-block;
}

/* ===== ФОРМА ДОБАВЛЕНИЯ ВИДЖЕТА ===== */
#addWidgetForm {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 10px;
    margin-top: 10px;
}

#addWidgetForm .form-group {
    margin-bottom: 12px;
}

#addWidgetForm .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 4px;
}

#addWidgetForm .form-group input,
#addWidgetForm .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

#addWidgetForm .form-group input:focus,
#addWidgetForm .form-group select:focus {
    outline: none;
    border-color: #fc3f1d;
}

.btn-create {
    width: 100%;
    padding: 10px;
    background: #fc3f1d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-create:hover {
    background: #e63515;
}

.btn-cancel {
    width: 100%;
    padding: 8px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 6px;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-primary {
    padding: 10px 24px;
    background: #fc3f1d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #e63515;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(252, 63, 29, 0.3);
}

/* ===== ФУТЕР ===== */
footer {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.6);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

footer p {
    font-size: 14px;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 1024px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header .container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .logo h1 {
        font-size: 20px;
        text-align: center;
    }

    nav {
        justify-content: center;
    }

    .user-info {
        padding: 4px 10px 4px 4px;
    }

    .user-name {
        font-size: 13px;
    }

    /* Кабинет */
    .cabinet-container {
        flex-direction: column;
        padding: 15px 0;
        gap: 20px;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .widgets-grid {
        grid-template-columns: 1fr;
    }

    /* Скретч-виджет - две колонки становятся одна */
    .scratch-widget-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: auto;
    }
    
    .scratch-left {
        min-height: 200px;
    }
    
    .scratch-container {
        min-height: 200px;
    }
    
    .scratch-container .scratch-result {
        padding: 15px;
    }
    
    .promo-code-value {
        font-size: 36px;
        letter-spacing: 6px;
    }
    
    .scratch-right {
        min-height: 120px;
        padding: 20px;
    }
    
    .hint-text {
        font-size: 17px;
    }
    
    .hint-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    /* Главная */
    .hero {
        padding: 40px 15px;
    }

    .hero h2 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .btn-login-large {
        padding: 14px 30px;
        font-size: 16px;
        width: 100%;
        justify-content: center;
    }

    .widget-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }

    .hero h2 {
        font-size: 24px;
    }

    .btn-login,
    .btn-logout {
        font-size: 13px;
        padding: 6px 16px;
    }

    .widget-title h3 {
        font-size: 15px;
    }

    .widget-actions a {
        font-size: 16px;
        padding: 3px 6px;
    }
    
    .scratch-left {
        min-height: 150px;
    }
    
    .scratch-container {
        min-height: 150px;
    }
    
    .promo-code-value {
        font-size: 28px;
        letter-spacing: 4px;
    }
    
    .hint-text {
        font-size: 15px;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
   ============================================ */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* ============================================
   ПЕЧАТЬ
   ============================================ */
@media print {
    header,
    .sidebar,
    .widget-actions,
    .btn-copy,
    .btn-reset-scratch,
    .btn-back {
        display: none !important;
    }

    .cabinet-container {
        display: block !important;
    }

    .content {
        width: 100% !important;
    }

    .widget-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .scratch-container {
        break-inside: avoid;
    }
}

/* Стили для генерации кода */
.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
}

.code-tab {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.code-tab:hover {
    color: #1a1a2e;
}

.code-tab.active {
    background: white;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.code-content {
    display: none;
}

.code-content.active {
    display: block;
}

.code-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
    margin: 0 0 12px 0;
    max-height: 300px;
    overflow-y: auto;
}

.code-content code {
    font-family: 'Courier New', Consolas, monospace;
    line-height: 1.8;
    white-space: pre;
    font-size: 13px;
}

.code-content .btn-copy {
    margin-top: 0;
}

/* ===== УПРОЩЕННАЯ ГЕНЕРАЦИЯ КОДА ===== */
.code-simple {
    padding: 4px 0;
}

.code-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.code-simple pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
    margin: 0 0 10px 0;
}

.code-simple code {
    font-family: 'Courier New', Consolas, monospace;
    line-height: 1.8;
    white-space: pre;
    font-size: 13px;
}

.code-simple .btn-copy {
    padding: 6px 16px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.code-simple .btn-copy:hover {
    background: #27ae60;
    transform: scale(1.02);
}

/* ============================================
   ФОРМА В ПРАВОЙ ПАНЕЛИ
   ============================================ */

.scratch-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 300px;
}

.widget-form-container {
    width: 100%;
    max-width: 400px;
}

.widget-form-content {
    text-align: center;
}

.form-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.widget-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input.error {
    border-color: #e74c3c;
}

.form-submit-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.form-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   СООБЩЕНИЕ ОБ УСПЕХЕ
   ============================================ */

.widget-form-success {
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: #2ecc71;
    margin-bottom: 8px;
}

.success-text {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .scratch-widget-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: auto;
    }
    
    .scratch-left {
        min-height: 250px;
    }
    
    .scratch-container {
        min-height: 250px;
    }
    
    .scratch-right {
        min-height: auto;
        padding: 20px;
    }
    
    .widget-form-container {
        max-width: 100%;
    }
    
    .form-title {
        font-size: 18px;
    }
    
    .form-submit-btn {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .scratch-left {
        min-height: 200px;
    }
    
    .scratch-container {
        min-height: 200px;
    }
    
    .form-group input {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .form-submit-btn {
        font-size: 15px;
        padding: 12px 20px;
    }
}

.widget-email {
    color: #666;
    font-size: 12px;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
}

/* ===== СТИЛИ ДЛЯ РОЛЕЙ ===== */

.user-role.superadmin {
    background: #fc3f1d;
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.superadmin-badge {
    background: #fff3e0;
    color: #e65100;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.smtp-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.smtp-group {
    border-left: 3px solid #1976d2;
    background: #f8f9fa;
}

.smtp-status {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.superadmin-info {
    margin-top: 12px;
    padding: 10px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}