:root {
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --success: #00b894;
  --success-light: #55efc4;
  --error: #e74c3c;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
  --line-gradient: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
}

.dark {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1f2937;
  --text-primary: #f5f6fa;
  --text-secondary: #a4b0be;
  --text-muted: #636e72;
  --accent: #a29bfe;
  --accent-light: #6c5ce7;
  --accent-glow: rgba(162, 155, 254, 0.2);
  --success: #55efc4;
  --success-light: #00b894;
  --error: #ff6b6b;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  width: 100%;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.8s ease;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.phone-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 4px 20px var(--accent-glow);
  margin-top: 16px;
  direction: ltr;
}

.phone-badge svg {
  width: 22px;
  height: 22px;
}

.intro-text, .info-box {
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.intro-text p {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  margin: 0;
}

.intro-text .icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 10px;
}

.form-card, .card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: fadeInUp 0.6s ease;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 5px;
  background: var(--line-gradient);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-glow);
}

.section-title .icon {
  font-size: 1.3rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group label .required {
  color: var(--error);
  margin-right: 4px;
}

.form-group input,
.form-group select {
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 16px;
  font-family: 'Heebo', sans-serif;
  background: #fafafa;
  color: var(--text-primary);
  transition: all 0.25s ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 4px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.error-message.show {
  display: block;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-top: none;
  border-radius: 0 0 14px 14px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.submit-btn, .btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.submit-btn:hover, .btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.submit-btn:active, .btn-submit:active {
  transform: translateY(0);
}

.submit-btn svg {
  width: 24px;
  height: 24px;
}

.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-submit.loading::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-inline-start: 12px;
}

.success-message {
  display: none;
  text-align: center;
  padding: 40px;
  animation: fadeInUp 0.5s ease;
}

.success-message.show {
  display: block;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
  color: white;
  box-shadow: 0 8px 30px rgba(0, 184, 148, 0.3);
}

.spinner {
  animation: rotate 1s linear infinite;
  width: 60px;
  height: 60px;
}

.spinner .path {
  stroke: #4CAF50;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

@keyframes dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}



.success-message h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.success-message p {
  color: var(--text-secondary);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  padding: 28px;
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-hover);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-content p {
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: 1rem;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.modal-btn.cancel {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.modal-btn.cancel:hover {
  background: var(--border);
}

.modal-btn.confirm {
  background: var(--accent);
  color: white;
}

.modal-btn.confirm:hover {
  background: var(--accent-light);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .container { padding: 24px 16px 80px; }
  .header h1 { font-size: 1.6rem; }
  .phone-badge { font-size: 1rem; padding: 10px 20px; }
  .form-card { padding: 24px 20px; border-radius: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .section-title { font-size: 1.05rem; }
  .submit-btn, .btn-submit { font-size: 1rem; padding: 16px 28px; }
}