.modern-form-container {
  background-color: var(--bg-page, #f8fafc);
  min-height: calc(100vh - 120px);
  padding: 30px 0 50px;
  transition: background-color 0.3s ease;
}

.modern-form-card {
  background: var(--bg-card, #ffffff);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  transition: all 0.3s ease;
}

[data-theme="dark"] .modern-form-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.form-header {
  background: linear-gradient(135deg, var(--tg-blue, #0088cc) 0%, #005580 100%);
  padding: 28px 20px 24px;
  text-align: center;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin: 20px 20px 0 20px;
}

.form-header-bg-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  border-radius: 50%;
}

.form-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 15px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-header-icon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.12) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 36px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-header-icon:hover {
  transform: scale(1.08) rotate(-5deg);
}

.form-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.4px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.form-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  font-weight: 400;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.form-body {
  padding: 36px 40px;
}

.alert-modern {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 28px;
}

.alert-success-modern {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid #10b981;
  color: #065f46;
}

[data-theme="dark"] .alert-success-modern {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.alert-danger-modern {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

[data-theme="dark"] .alert-danger-modern {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.alert-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.alert-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.form-section-header i {
  color: var(--tg-blue, #0088cc);
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.form-group-modern.full-width {
  grid-column: 1 / -1;
}

.form-label-modern {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main, #334155);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-label-modern i {
  color: var(--tg-blue, #0088cc);
  font-size: 16px;
}

.required-badge {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

.optional-badge {
  background: var(--border-color, #f1f5f9);
  color: var(--text-muted, #64748b);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
}

.tooltip-icon {
  margin-left: auto;
  color: var(--text-muted, #94a3b8);
  cursor: help;
  transition: color 0.2s ease;
}

.tooltip-icon:hover {
  color: var(--tg-blue, #0088cc);
}

.form-control-modern {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  font-size: 14px;
  transition: all 0.25s ease;
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--tg-blue, #0088cc);
  box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.12);
}

.form-control-modern::placeholder {
  color: var(--text-muted, #94a3b8);
}

.file-input-modern {
  padding: 10px 14px;
  cursor: pointer;
}

.file-input-modern::file-selector-button {
  background: rgba(0, 136, 204, 0.08);
  color: var(--tg-blue, #0088cc);
  border: 1px solid rgba(0, 136, 204, 0.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  margin-right: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-input-modern::file-selector-button:hover {
  background: var(--tg-blue, #0088cc);
  color: #ffffff;
}

.select-modern {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-hint {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  margin-top: 6px;
}

.form-error {
  display: block;
  font-size: 12.5px;
  color: #ef4444;
  margin-top: 6px;
  font-weight: 500;
}

.info-box-modern {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(0, 136, 204, 0.06);
  border: 1px solid rgba(0, 136, 204, 0.15);
  border-left: 4px solid var(--tg-blue, #0088cc);
  border-radius: 12px;
}

.info-icon {
  color: var(--tg-blue, #0088cc);
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-content {
  flex: 1;
}

.info-content p {
  margin: 0;
  color: var(--text-main, #334155);
  font-size: 13.5px;
  line-height: 1.5;
}

.info-content a {
  color: var(--tg-blue, #0088cc);
  font-weight: 600;
  text-decoration: none;
}

.info-content a:hover {
  text-decoration: underline;
}

.btn-submit-modern {
  width: 100%;
  padding: 15px 28px;
  background: linear-gradient(135deg, var(--tg-blue, #0088cc) 0%, #0077b5 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.28);
}

.btn-submit-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.38);
  background: linear-gradient(135deg, #0099e6 0%, #0088cc 100%);
}

.btn-submit-modern:active {
  transform: translateY(0);
}

.btn-submit-modern i:last-child {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.btn-submit-modern:hover i:last-child {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .modern-form-container {
    padding: 15px 0 30px;
  }
  
  .form-header {
    padding: 24px 16px;
    margin: 15px 15px 0 15px;
    border-radius: 14px;
  }
  
  .form-body {
    padding: 24px 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  
  .form-title {
    font-size: 22px;
  }
  
  .form-header-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }
}


