/* ============================================================
   Отмена судебного приказа — Style v4.1
   Современный дружелюбный дизайн + fintech-стиль блока даты
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-soft: #eff6ff;
    --header-bg: #1e40af;
    
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --error: #ef4444;
    --error-soft: #fef2f2;
    
    --bg: #f5f7fb;
    --card: #ffffff;
    --input-bg: #f8fafc;
    --hover: #f1f5f9;
    
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(37, 99, 235, 0.35);
    
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* ============================================================
   ШАПКА
   ============================================================ */

.header {
    background: var(--header-bg);
    color: white;
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: white;
    padding: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin: 0;
}

.subtitle {
    opacity: 0.75;
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
}

/* ============================================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================================ */

main {
    flex: 1;
    padding: 24px 0 40px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: block;
}

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

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card.center {
    text-align: center;
}

.card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.4px;
    line-height: 1.3;
}

.hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hint-small {
    font-size: 12px;
    margin-top: 8px;
    margin-bottom: 0;
}

/* ============================================================
   ВКЛАДКИ
   ============================================================ */

.upload-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--input-bg);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: inherit;
}

.tab svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab.active svg {
    opacity: 1;
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* ============================================================
   ЗАГРУЗКА ФОТО
   ============================================================ */

.upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-slow);
    background: var(--input-bg);
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.upload-area:active {
    transform: translateY(0);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 16px;
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    transform: scale(1.08);
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.preview {
    position: relative;
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.preview img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    box-shadow: var(--shadow);
}

.btn-text {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-text:hover {
    background: rgba(15, 23, 42, 0.95);
}

/* ============================================================
   TEXTAREA
   ============================================================ */

textarea {
    width: 100%;
    min-height: 220px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
    line-height: 1.6;
    background: var(--input-bg);
    color: var(--text);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea::placeholder {
    color: var(--text-light);
}

/* ============================================================
   БЛОК «ДАТА ВРУЧЕНИЯ ПРИКАЗА» — fintech-стиль
   ============================================================ */

.delivery-card {
    margin: 16px 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.delivery-card:hover {
    border-color: var(--border-strong);
}

.delivery-card:has(.delivery-toggle[aria-expanded="true"]) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.delivery-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: var(--text);
    transition: background var(--transition);
}

.delivery-toggle:hover {
    background: var(--input-bg);
}

.delivery-toggle-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.delivery-toggle[aria-expanded="true"] .delivery-toggle-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.delivery-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.delivery-toggle-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    line-height: 1.3;
    color: var(--text);
}

.delivery-toggle-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.delivery-toggle-chevron {
    color: var(--text-light);
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color var(--transition);
}

.delivery-toggle[aria-expanded="true"] .delivery-toggle-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.delivery-content {
    display: none;
    padding: 4px 18px 20px;
}

.delivery-content.open {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ---------- Сегментированный переключатель ---------- */

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.segmented-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.segmented-btn:hover:not(.active) {
    color: var(--text);
    background: rgba(15, 23, 42, 0.04);
}

.segmented-btn.active {
    background: var(--card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ---------- Блок восстановления срока ---------- */

.restoration-block {
    margin-top: 16px;
    padding: 16px;
    background: var(--warning-soft);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease-out;
}

.restoration-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.restoration-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: var(--warning);
    border-radius: 10px;
    flex-shrink: 0;
}

.restoration-text { flex: 1; min-width: 0; }

.restoration-title {
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
    line-height: 1.3;
    margin-bottom: 2px;
    letter-spacing: -0.1px;
}

.restoration-subtitle {
    font-size: 12.5px;
    color: #92400e;
    line-height: 1.4;
}

.restoration-block .form-group { margin-bottom: 12px; }
.restoration-block .form-group:last-child { margin-bottom: 0; }

.restoration-block .form-group label {
    color: #78350f;
    font-weight: 600;
}

.restoration-block .form-group input,
.restoration-block .form-group select {
    background: #ffffff;
    border-color: #fde68a;
}

.restoration-block .form-group input:focus,
.restoration-block .form-group select:focus {
    border-color: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ============================================================
   ФОРМЫ
   ============================================================ */

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: var(--transition);
}

.input-with-icon input {
    padding-left: 42px;
}

.input-with-icon input:focus + .input-icon,
.input-with-icon:focus-within .input-icon {
    color: var(--primary);
}

/* ============================================================
   СОГЛАСИЕ НА ОБРАБОТКУ ПД
   ============================================================ */

.consent-block {
    margin: 20px 0;
    padding: 16px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.consent-block:hover {
    border-color: var(--border-strong);
}

.consent-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.consent-label input[type="checkbox"] {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary);
    border-radius: 6px;
}

.consent-label a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
    text-underline-offset: 2px;
}

.consent-label a:hover {
    color: var(--primary-dark);
}

/* ============================================================
   КНОПКИ
   ============================================================ */

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
    font-family: inherit;
    box-shadow: var(--shadow-primary);
    letter-spacing: -0.2px;
}

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

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
}

.btn-primary:disabled {
    background: var(--text-light);
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-primary:disabled:hover {
    background: var(--text-light);
    transform: none;
    box-shadow: none;
}

.btn-primary svg {
    transition: transform 0.2s;
}

.btn-primary:hover:not(:disabled) svg {
    transform: translateX(3px);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: var(--transition);
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-text-link {
    display: block;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    text-align: center;
}

.btn-text-link:hover {
    color: var(--primary);
}

/* ============================================================
   СПИННЕР
   ============================================================ */

.spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   РЕЗУЛЬТАТ
   ============================================================ */

.success-icon,
.error-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.deadline-info {
    padding: 14px 16px;
    background: var(--success-soft);
    color: #065f46;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
    border-left: 4px solid var(--success);
}

.document-preview {
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    position: relative;
}

.document-preview pre {
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* ============================================================
   БЛОК ОПЛАТЫ
   ============================================================ */

.payment-block {
    margin: 20px 0;
    padding: 20px;
    background: var(--warning-soft);
    border-radius: var(--radius-sm);
    border: 1px solid #fde68a;
    text-align: center;
}

.payment-hint {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 16px;
    line-height: 1.5;
}

.payment-hint strong {
    font-size: 18px;
    color: #78350f;
    font-weight: 700;
}

.paid-block {
    margin: 20px 0;
    padding: 20px;
    background: var(--success-soft);
    border-radius: var(--radius-sm);
    border: 1px solid #a7f3d0;
    text-align: center;
}

.paid-success {
    font-size: 14px;
    color: #065f46;
    margin-bottom: 16px;
    font-weight: 600;
}

.paid-block .btn-primary,
.paid-block .btn-secondary {
    margin-top: 0;
    margin-bottom: 10px;
}

/* ============================================================
   SEO-КОНТЕНТ
   ============================================================ */

.seo-content {
    background: #ffffff;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.4px;
}

.seo-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--text);
}

.seo-content p {
    margin-bottom: 12px;
    color: #475569;
    line-height: 1.7;
    font-size: 15px;
}

.seo-content ul,
.seo-content ol {
    margin: 12px 0 12px 24px;
    color: #475569;
}

.seo-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 15px;
}

.seo-content strong {
    color: var(--text);
    font-weight: 600;
}

.seo-content .hint {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   ФУТЕР
   ============================================================ */

.footer {
    padding: 32px 0 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--card);
    margin-top: auto;
}

.footer p {
    margin-bottom: 6px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   УТИЛИТЫ
   ============================================================ */

.hidden {
    display: none !important;
}

/* ============================================================
   ВАЛИДАЦИЯ ФОРМЫ
   ============================================================ */

#receipt-email.invalid {
    border-color: var(--error);
    background: var(--error-soft);
}

#receipt-email.invalid:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 480px) {
    .header {
        padding: 18px 0;
    }
    
    .header-logo {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    
    .header-text h1 {
        font-size: 17px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .card {
        padding: 22px;
        border-radius: 16px;
    }
    
    .card h2 {
        font-size: 19px;
    }
    
    .upload-area {
        padding: 32px 16px;
    }
    
    .upload-icon {
        width: 52px;
        height: 52px;
    }
    
    .btn-primary {
        padding: 14px;
        font-size: 14px;
    }
    
    .success-icon svg,
    .error-icon svg {
        width: 56px;
        height: 56px;
    }
    
    .document-preview {
        padding: 16px;
        max-height: 320px;
    }
    
    .document-preview pre {
        font-size: 12px;
    }
    
    .seo-content {
        padding: 24px 0;
        margin-top: 24px;
    }
    
    .seo-content h2 {
        font-size: 19px;
    }
    
    .seo-content h3 {
        font-size: 16px;
    }

    .delivery-toggle {
        padding: 14px;
        gap: 12px;
    }
    .delivery-toggle-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .delivery-toggle-title { font-size: 14px; }
    .delivery-content { padding: 4px 14px 18px; }
    .segmented-btn {
        font-size: 12.5px;
        padding: 9px 6px;
    }
}