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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
    background: white;
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .half {
    flex: 1;
}

small {
    display: block;
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}

.required {
    color: #e74c3c;
}

button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.error {
    background: #fee;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #c0392b;
    margin-bottom: 20px;
}

.info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

.info ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.info ul li {
    margin: 6px 0;
    color: #555;
}

/* Футер */
.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

/* Success page */
.success-box {
    text-align: center;
}

.success-box h1 {
    color: #27ae60;
}

.result {
    margin: 30px 0;
}

.short-url {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    word-break: break-all;
}

.short-url a {
    color: #667eea;
    font-size: 20px;
    text-decoration: none;
    font-weight: 600;
}

.short-url a:hover {
    text-decoration: underline;
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-copy,
.btn-new,
.btn-copy-pin,
.btn-qr,
.btn-stats,
.btn-back,
.btn-go {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-copy {
    background: #3498db;
    color: white;
}

.btn-copy:hover {
    background: #2980b9;
}

.btn-copy-pin {
    background: #f39c12;
    color: white;
}

.btn-copy-pin:hover {
    background: #e67e22;
}

.btn-new {
    background: #27ae60;
    color: white;
}

.btn-new:hover {
    background: #229954;
}

.btn-qr {
    background: #6c757d;
    color: white;
}

.btn-qr:hover {
    background: #5a6268;
}

.btn-stats {
    background: #6f42c1;
    color: white;
}

.btn-stats:hover {
    background: #5a32a3;
}

.btn-back {
    background: #6c757d;
    color: white;
}

.btn-back:hover {
    background: #5a6268;
}

.btn-go {
    background: #667eea;
    color: white;
}

.btn-go:hover {
    background: #5a6fd6;
}

.stats-link {
    margin-top: 16px;
    text-align: center;
}

/* Password page */
.password-box {
    text-align: center;
}

.password-box h1 {
    font-size: 32px;
}

.password-box p {
    color: #666;
    margin: 12px 0 24px;
}

.password-box a {
    display: inline-block;
    margin-top: 16px;
    color: #667eea;
    text-decoration: none;
}

/* Error page */
.error-box {
    text-align: center;
}

.error-box h1 {
    color: #e74c3c;
}

.error-box p {
    margin: 16px 0 24px;
    color: #666;
}

/* Protection block */
.protection-block {
    background: #f8f9fa;
    padding: 16px 20px;
    border-radius: 10px;
    margin: 16px 0 20px 0;
    border: 2px solid #e9ecef;
}

.block-title {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.switch-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.switch-label input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 12px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.switch-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-label input:checked + .switch-slider {
    background: #667eea;
}

.switch-label input:checked + .switch-slider::after {
    left: 20px;
}

.switch-text {
    font-size: 14px;
    color: #333;
}

.conditional {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-with-hint {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-hint input {
    flex: 1;
}

.hint {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 150px;
}

.pin-info {
    background: #fef9e7;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 2px dashed #f39c12;
}

.pin-code {
    font-size: 32px;
    font-weight: bold;
    color: #e67e22;
    letter-spacing: 8px;
    font-family: monospace;
    padding: 8px;
}

.protection-badges {
    margin: 20px 0 16px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: #e7f3ff;
    color: #0066cc;
    font-size: 13px;
    font-weight: 500;
}

/* QR-код */
.qr-section {
    margin: 24px 0 16px;
    text-align: center;
}

.qr-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    font-size: 15px;
}

.qr-container {
    background: white;
    padding: 12px;
    border-radius: 12px;
    display: inline-block;
    border: 2px solid #e9ecef;
}

.qr-container img {
    display: block;
    border-radius: 4px;
}

.qr-actions {
    margin-top: 12px;
}

/* ============================================
   СТАТИСТИКА
   ============================================ */
.stats-container {
    max-width: 700px;
    margin: 0 auto;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-header h1 {
    font-size: 24px;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.stats-card {
    background: #f8f9fa;
    padding: 18px 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: 0.2s;
}

.stats-card:hover {
    border-color: #667eea;
}

.stats-card .number {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.stats-card .label {
    color: #6c757d;
    font-size: 13px;
    margin-top: 4px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 15px;
}

.stats-table tr {
    border-bottom: 1px solid #f1f3f5;
}

.stats-table td {
    padding: 12px 10px;
}

.stats-table td:first-child {
    font-weight: 600;
    color: #495057;
    width: 35%;
}

.stats-table td:last-child {
    color: #212529;
    word-break: break-word;
}

.badge-protection {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: #e7f3ff;
    color: #0066cc;
    font-size: 13px;
    margin: 2px 4px 2px 0;
}

.badge-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

.stats-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stats-divider {
    border: none;
    border-top: 2px solid #f1f3f5;
    margin: 24px 0;
}

.stats-empty {
    color: #6c757d;
    text-align: center;
    padding: 20px 0;
}

/* ============================================
   ОБРАТНАЯ СВЯЗЬ
   ============================================ */
.feedback-container {
    max-width: 600px;
    margin: 0 auto;
}

.feedback-form {
    margin: 20px 0;
}

.feedback-form .form-group {
    margin-bottom: 16px;
}

.feedback-form .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.feedback-form .form-group input,
.feedback-form .form-group textarea,
.feedback-form .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: white;
}

.feedback-form .form-group input:focus,
.feedback-form .form-group textarea:focus,
.feedback-form .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

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

.feedback-form .error-text {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

.feedback-form .field-error {
    border-color: #e74c3c !important;
}

.feedback-form .btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.feedback-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin: 20px 0;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    margin-bottom: 16px;
}

.optional {
    color: #888;
    font-weight: 400;
    font-size: 13px;
}

.feedback-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.feedback-types label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
    background: #fafafa;
    transition: all 0.2s;
}

.feedback-types label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.feedback-types input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    flex-shrink: 0;
    margin: 0;
}

.feedback-types label:has(input:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

.back-link {
    display: inline-block;
    margin-top: 16px;
    color: #667eea;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

  .terms-content {
                text-align: left;
                font-size: 15px;
                line-height: 1.7;
                color: #333;
            }
            .terms-content h2 {
                margin-top: 24px;
                font-size: 20px;
                color: #333;
            }
            .terms-content p {
                margin-bottom: 12px;
            }
            .terms-content ul {
                margin: 8px 0 16px 20px;
            }
            .terms-content ul li {
                margin-bottom: 6px;
            }
            .terms-content .highlight {
                background: #fef9e7;
                padding: 16px 20px;
                border-left: 4px solid #f39c12;
                border-radius: 4px;
                margin: 16px 0;
            }
            .terms-footer {
                margin-top: 30px;
                padding-top: 20px;
                border-top: 2px solid #f0f0f0;
                text-align: center;
                font-size: 13px;
                color: #888;
            }
            .back-link {
                display: inline-block;
                margin-top: 10px;
                color: #667eea;
                text-decoration: none;
            }
            .back-link:hover {
                text-decoration: underline;
            }

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    h1 {
        font-size: 22px;
    }

    .actions {
        flex-direction: column;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .input-with-hint {
        flex-direction: column;
        align-items: stretch;
    }

    .hint {
        text-align: center;
        min-width: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feedback-types {
        grid-template-columns: 1fr;
    }
}