/* Magic Trans — styles (palette from brand.md) */
:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --text: #1B2733;
  --accent: #F5A623;
  --accent-dark: #0B3B66;
  --neutral: #E7EAF0;
  --err: #D64545;
  --ok: #2E8B57;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 59, 102, 0.10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
code { background: var(--neutral); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.view { animation: fadeIn 250ms cubic-bezier(0.25, 0.1, 0.25, 1); }

h1 { font-size: 30px; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 23px; letter-spacing: -0.01em; line-height: 1.2; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }

/* Header */
.site-header {
  background: var(--accent-dark);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; font-size: 18px; }
.brand-name { letter-spacing: 0.02em; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; }
.nav a { color: rgba(255,255,255,0.9); font-size: 15px; }
.nav a:hover { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: 0.02em; transition: background 160ms cubic-bezier(0.42,0,0.58,1), transform 160ms cubic-bezier(0.42,0,0.58,1), box-shadow 160ms;
  font-family: var(--font);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #1B2733; }
.btn-primary:hover { background: #ffb83d; }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Hero */
.hero { background: var(--accent-dark); color: #fff; padding: 46px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.hero-text h1 { font-size: 34px; }
.hero-sub { color: rgba(255,255,255,0.85); font-size: 17px; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); }
.section-cta { background: var(--accent-dark); color: #fff; }
.section-title { margin: 0 0 6px; }
.section-lead { color: #5a6774; margin-bottom: 26px; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.service-card {
  background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius);
  padding: 22px 18px; box-shadow: var(--shadow); transition: transform 160ms cubic-bezier(0.42,0,0.58,1), box-shadow 160ms;
  animation: rise 300ms cubic-bezier(0.25,0.1,0.25,1) both;
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(11,59,102,0.16); }
.service-card img { width: 44px; height: 44px; margin-bottom: 12px; }
.service-card h3 { margin: 0 0 6px; }
.service-card p { color: #5a6774; font-size: 14px; margin: 0; }

/* Process */
.process-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: center; }
.process-wrap > img { border-radius: var(--radius); box-shadow: var(--shadow); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1B2733;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.steps b { display: block; font-size: 16px; }
.steps span { color: #5a6774; font-size: 14px; }

/* About */
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* CTA */
.cta-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.cta-inner > img { border-radius: var(--radius); box-shadow: var(--shadow); order: 2; }
.cta-text .section-title { color: #fff; }
.cta-text p { color: rgba(255,255,255,0.85); }

/* Form */
.form-container { max-width: 620px; }
.lead-form { background: var(--surface); padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-full { grid-column: 1 / -1; }
.field span { font-size: 14px; font-weight: 600; }
.field i { color: var(--err); font-style: normal; }
.field input, .field select, .field textarea {
  padding: 11px 13px; border: 1px solid var(--neutral); border-radius: 9px; font-size: 15px;
  font-family: var(--font); background: #fff; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-dark); border-color: var(--accent-dark); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err); }
.err { color: var(--err); font-size: 12px; min-height: 14px; }
.agree { flex-direction: row; align-items: flex-start; gap: 10px; }
.agree input { width: auto; margin-top: 3px; }
.lead-form .btn { grid-column: 1 / -1; }
.form-result { grid-column: 1 / -1; border-radius: 9px; padding: 12px 14px; font-size: 14px; }
.form-result.ok { background: #e7f5ec; color: var(--ok); }
.form-result.bad { background: #fdeaea; color: var(--err); }

/* Contacts */
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.contact-item { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 20px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); }
.contact-item span { font-size: 15px; }

/* Footer */
.site-footer { background: var(--accent-dark); color: rgba(255,255,255,0.85); padding: 24px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner .brand { color: #fff; }
.footer-inner p { margin: 0; font-size: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--accent-dark), #0e4d85); }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.brand-center { color: var(--text); justify-content: center; margin-bottom: 8px; }
.login-card h2 { margin: 6px 0 4px; }
.login-hint { color: #5a6774; }
.login-demo { color: #5a6774; font-size: 13px; margin-top: 14px; }
.login-card .lead-form { padding: 0; box-shadow: none; }

/* Panel */
.panel-topbar { background: var(--accent-dark); color: #fff; }
.panel-topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.panel-badge { background: var(--accent); color: #1B2733; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.badge-dot { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.panel-body { padding: 24px 20px 60px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.tab { background: var(--surface); border: 1px solid var(--neutral); border-radius: 9px; padding: 9px 16px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font); }
.tab.active { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.panel-tab { display: none; }
.panel-tab.active { display: block; animation: fadeIn 250ms cubic-bezier(0.25,0.1,0.25,1); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card b { font-size: 28px; display: block; color: var(--accent-dark); }
.stat-card span { font-size: 13px; color: #5a6774; }

.chart-card { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.chart-card canvas { width: 100%; height: auto; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { padding: 10px 12px; border: 1px solid var(--neutral); border-radius: 9px; font-size: 14px; font-family: var(--font); }

.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-row .grow { flex: 1 1 220px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.meta { color: #5a6774; font-size: 13px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; }
.badge-Новая { background: #0B3B66; }
.badge-В работе { background: #F5A623; color: #1B2733; }
.badge-Выполнена { background: #2E8B57; }
.badge-Оплачена { background: #5b3cc4; }
.badge-Отклонена { background: #D64545; }
.status-select { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--neutral); font-family: var(--font); font-size: 13px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions .btn { padding: 7px 12px; font-size: 13px; }
.empty { background: var(--surface); border: 1px dashed var(--neutral); border-radius: var(--radius); padding: 36px; text-align: center; color: #5a6774; }
.empty img { width: 64px; height: 64px; margin: 0 auto 12px; }

.settings-card { background: var(--surface); border: 1px solid var(--neutral); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(11,27,51,0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; animation: fadeIn 200ms; }
.modal-card { background: var(--surface); border-radius: var(--radius); padding: 26px; width: 100%; max-width: 480px; position: relative; box-shadow: var(--shadow); animation: rise 220ms cubic-bezier(0.25,0.1,0.25,1); }
.modal-close { position: absolute; top: 10px; right: 12px; background: transparent; border: 0; font-size: 26px; cursor: pointer; color: #5a6774; }
.modal-card .lead-form { padding: 0; box-shadow: none; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.badge-dot.alert { animation: pulse 800ms ease-in-out infinite; }

/* Responsive */
@media (max-width: 720px) {
  h1 { font-size: 26px; }
  .hero-inner, .about-inner, .cta-inner, .process-wrap { grid-template-columns: 1fr; }
  .cta-inner > img { order: 0; }
  .lead-form { grid-template-columns: 1fr; }
  .field-full, .lead-form .btn, .form-result { grid-column: 1; }
  .header-inner { gap: 10px; }
  .nav { order: 3; width: 100%; justify-content: space-between; }
  .header-actions { margin-left: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .view, .panel-tab.active, .modal, .modal-card, .service-card { animation: none; }
  .badge-dot.alert { animation: none; }
}
