/* ============================================
   ===== PREMIUM MINIMALIST DESIGN =====
   ===== Вдохновлено LaCrapule Studio =====
   ============================================ */

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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e4e4e7;
  --border-hover: #a1a1aa;
  
  --text-primary: #09090b;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  
  --accent: #09090b;
  --accent-hover: #27272a;
  
  --success: #09090b;
  --success-bg: #f4f4f5;
  --error: #dc2626;
  --error-bg: #fef2f2;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { 
  max-width: 900px;
  width: 90%; 
  margin: 0 auto; 
  padding: 60px 20px;
}

/* ============================================
   ===== АНИМАЦИИ =====
   ============================================ */
@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.animate-in {
  animation: fadeInUp 0.8s var(--ease-premium) forwards;
  opacity: 0;
}

/* ============================================
   ===== HEADER =====
   ============================================ */
.header { 
  padding: 20px 0 48px;
  text-align: center;
}

.header-top { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  margin-bottom: 24px; 
}

.back-btn {
  width: 40px; 
  height: 40px; 
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 50%; 
  font-size: 18px; 
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.4s var(--ease-premium);
}

.back-btn:hover {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

h1 { 
  font-size: 28px; 
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.header-subtitle { 
  color: var(--text-secondary); 
  font-size: 15px; 
  font-weight: 400;
  letter-spacing: -0.01em;
}

.logout-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
  letter-spacing: 0.02em;
}

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

/* ============================================
   ===== CARDS & SURFACES =====
   ============================================ */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.3s var(--ease-premium);
}

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

.card-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.card-header h2 { 
  font-size: 15px; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--success-bg);
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.card-body { 
  padding: 40px; 
}


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.input-field {
  font-size: 14px;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   ===== МОДАЛЬНЫЕ ДИАЛОГИ (custom-dialog) =====
   ============================================ */
.custom-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  background: var(--bg, #ffffff);
  color: var(--text-primary, #1a1a1a);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.custom-dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

.dialog-content {
  padding: 24px;
}

.dialog-header {
  margin-bottom: 16px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #1a1a1a);
}

.dialog-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #666);
  margin: 0 0 16px 0;
}

.dialog-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary, #1a1a1a);
}

.dialog-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.progress-container {
  background: var(--border, #e5e5e5);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  width: 100%;
  height: 100%;
  appearance: none;
  background: var(--border, #e5e5e5);
}

.progress-bar::-webkit-progress-bar { 
  background: var(--border, #e5e5e5); 
}

.progress-bar::-webkit-progress-value {
  background: var(--text-primary, #1a1a1a);
  transition: width 0.3s ease;
}

.progress-bar::-moz-progress-bar {
  background: var(--text-primary, #1a1a1a);
  transition: width 0.3s ease;
}

.timer-text {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin: 0;
  text-align: center;
}

.custom-dialog[open] {
  animation: dialog-fade-in 0.3s ease-out;
}

@keyframes dialog-fade-in {
  from { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); 
  }
}

.dialog-footer button {
  cursor: pointer;
  transition: all 0.2s;
}

.dialog-footer button:hover {
  opacity: 0.9;
}

/* ============================================
   ===== SUMMARY =====
   ============================================ */
.summary { 
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 32px;
  margin-bottom: 32px;
}

.summary-row { 
  display: flex; 
  justify-content: space-between; 
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
}

.summary-row.total span:last-child {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ============================================
   ===== FORMS =====
   ============================================ */
.form-group { 
  margin-bottom: 24px; 
}

.form-group label { 
  display: block; 
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.3s var(--ease-premium);
  background: var(--bg);
  color: var(--text-primary);
}

.form-group input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.form-group input.error { 
  border-color: var(--error);
}

.error-text { 
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.form-group input.error + .error-text { 
  display: block;
}

/* ============================================
   ===== PAYMENT METHODS =====
   ============================================ */
.payment-methods { 
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
}

.payment-method:hover {
  border-color: var(--border-hover);
}

.payment-method.active { 
  border-color: var(--text-primary);
  background: var(--surface);
}

.pm-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pm-logo { 
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.pm-info { flex: 1; }

.pm-name { 
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.pm-desc { 
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.pm-check {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-premium);
}

.payment-method.active .pm-check { 
  border-color: var(--text-primary);
  background: var(--text-primary);
}

.payment-method.active .pm-check::after { 
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* ============================================
   ===== CONSENTS =====
   ============================================ */
.consent-group { 
  margin-bottom: 32px;
}

.consent-item { 
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
}

.consent-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--text-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.consent-item span { 
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consent-item a { 
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   ===== BUTTONS =====
   ============================================ */
.btn {
  width: 100%;
  padding: 18px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s var(--ease-premium);
  text-align: center;
  letter-spacing: 0.02em;
}

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

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

.btn-primary:disabled { 
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-small { 
  padding: 10px 16px;
  font-size: 13px;
  width: auto;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease-premium);
}

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

.btn-small.danger { 
  color: var(--error);
  border-color: var(--error);
}

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

/* ============================================
   ===== КАТАЛОГ УСЛУГ =====
   ============================================ */
.services-catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s var(--ease-premium);
  position: relative;
}

.service-card:hover {
  border-color: var(--text-primary);
  transform: translateY(-4px);
}

.service-card.featured {
  border-color: var(--text-primary);
  background: var(--surface);
}

.service-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--text-primary);
  color: white;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-header { 
  text-align: left;
  margin-bottom: 24px;
}

.service-icon { 
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
  filter: grayscale(100%);
  opacity: 0.8;
}

.service-header h2 { 
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.service-price { 
  font-size: 36px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-top: 16px;
}

.service-subprice { 
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.service-features { 
  list-style: none;
  margin-bottom: 32px;
  flex-grow: 1;
}

.service-features li {
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-features li:last-child { 
  border-bottom: none;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================
   ===== РЕКВИЗИТЫ =====
   ============================================ */
.recipient-info {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.recipient-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.recipient-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.r-label { color: var(--text-secondary); }
.r-value { color: var(--text-primary); font-weight: 500; }

.inn-number {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
}

/* ============================================
   ===== SVG ICONS =====
   ============================================ */
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ============================================
   ===== PAYMENT LOGOS =====
   ============================================ */
.payment-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  transition: all 0.2s ease;
}

.payment-logo:hover {
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.card-logos {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ============================================
   ===== FOOTER =====
   ============================================ */
.site-footer {
  margin-top: 60px;
  padding: 32px 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-top a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.footer-top a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-legal {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-legal span {
  white-space: nowrap;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   ===== АДМИН-ПАНЕЛЬ =====
   ============================================ */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

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

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.tab-content {
  display: none;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.admin-table th {
  background: var(--bg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.admin-table tr:hover td {
  background: var(--bg);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

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

/* ============================================
   ===== RESPONSIVE =====
   ============================================ */
@media (max-width: 768px) {
  .container { width: 92%; padding: 24px 16px; }
  .services-catalog { grid-template-columns: 1fr; gap: 16px; }
  .card-body { padding: 24px; }
  h1 { font-size: 24px; }
  .service-price { font-size: 32px; }
  
  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .footer-legal {
    flex-direction: column;
    gap: 8px;
  }

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

  .admin-table {
    font-size: 12px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
  }
}