/* Max Fin-Tech — финтех-тематика, адаптив */

:root {
  --primary: #0a2540;
  --primary-light: #1a365d;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 12px rgba(37, 99, 235, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: var(--primary);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav .btn-logout {
  margin-left: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 0.2s;
}

.nav .btn-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Hamburger menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Main content */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  color: #fff;
  box-shadow: var(--shadow-hover);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Cards grid */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex: 1 1 280px;
  min-width: 0;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(37, 99, 235, 0.25);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Page title (inner pages) */
.page-hero {
  margin-bottom: 2rem;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Content block */
.content-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.content-block h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.content-block p,
.content-block ul {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.content-block ul {
  padding-left: 1.25rem;
}

.content-block li {
  margin-bottom: 0.35rem;
}

/* Feature list */
.features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(37, 99, 235, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.feature-row span:first-child {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature-row div strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.feature-row div span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1e3a5f 100%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-box .logo {
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.login-box .logo-icon {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
}

.login-box h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.login-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-form .btn-primary {
  margin-top: 0.5rem;
  padding: 0.85rem;
}

.login-error {
  color: #dc2626;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
  background: #fef2f2;
  border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.content-block a.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.content-block a.link:hover {
  text-decoration: underline;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
    z-index: 99;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    display: block;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: center;
  }

  .nav .btn-logout {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
  }

  .site-header {
    padding: 0.5rem 1rem;
  }

  .main {
    padding: 1rem;
  }

  .hero {
    padding: 1.5rem;
  }

  .content-block {
    padding: 1.25rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .cards .card {
    flex: 1 1 100%;
  }

  .login-box {
    padding: 1.5rem;
  }
}
